{"id":17636050,"url":"https://github.com/phjb/proagil","last_synced_at":"2025-03-30T03:43:24.370Z","repository":{"id":38556049,"uuid":"261527885","full_name":"phjb/ProAgil","owner":"phjb","description":"Curso Seja Full-Stack com Asp.NET Core Web API, Angular e EF Core","archived":false,"fork":false,"pushed_at":"2023-10-11T06:42:26.000Z","size":3077,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T06:14:34.379Z","etag":null,"topics":["angular9","asp-net-core","asp-net-core-mvc","csharp","vscode"],"latest_commit_sha":null,"homepage":"https://www.udemy.com/course/angular-dotnetcore-efcore/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phjb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-05T16:38:11.000Z","updated_at":"2020-05-25T22:20:29.000Z","dependencies_parsed_at":"2024-12-10T23:25:53.307Z","dependency_job_id":"71c20aa1-19fa-4ca8-86b2-539cfa7b7d68","html_url":"https://github.com/phjb/ProAgil","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"b2c658ed89a3e93fc20c994dd4d3875e9fdb0c9c"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phjb%2FProAgil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phjb%2FProAgil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phjb%2FProAgil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phjb%2FProAgil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phjb","download_url":"https://codeload.github.com/phjb/ProAgil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273515,"owners_count":20750904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular9","asp-net-core","asp-net-core-mvc","csharp","vscode"],"created_at":"2024-10-23T02:25:37.946Z","updated_at":"2025-03-30T03:43:24.343Z","avatar_url":"https://github.com/phjb.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProAgil\n\n###\n\n## Requests HTTP no Angular\n\nEm **_app.modules.ts_** importe o **HttpClientModule**\n\n`import { HttpClientModule } from '@angular/common/http';`\n\nO arquivo **_eventos.component.ts_** ficará da seguinte forma:\n\n```ts\nexport class EventosComponent implements OnInit {\n\n  eventos: any = [];\n\n  url = 'http://localhost:5000/api/eventos/';\n\n  constructor(private http: HttpClient) { }\n\n  ngOnInit(): void {\n    this.getEventos();\n  }\n\n  getEventos(): void {\n    this.http.get(this.url).subscribe(\n      response =\u003e {\n        this.eventos = response;\n      },\n      error =\u003e {\n        console.log(error);\n      });\n  }\n```\nÉ esperado o erro abaixo:\n\n![](screen/1.png)\n\nPara ajustar entre  no arquivo **Setup.cs** que está na pasta **ProAgil.API** e use o _Cors_\n\n```c#\npublic void ConfigureServices (IServiceCollection services)\n{\n    services.AddDbContext\u003cDataContext\u003e (x =\u003e x.UseSqlite (Configuration.GetConnectionString (\"DefaultConnection\")));\n    services.AddCors ();\n    services.AddControllers ();\n}\n\npublic void Configure (IApplicationBuilder app, IWebHostEnvironment env)\n{\n    if (env.IsDevelopment ())\n    {\n        app.UseDeveloperExceptionPage ();\n    }\n\n    app.UseCors (x =\u003e\n        x.AllowAnyOrigin () // permito toda origem\n       .AllowAnyMethod () // permito todos os metodos\n        .AllowAnyHeader () // permito todos cabeçalho\n        );\n\n    app.UseRouting ();\n    app.UseAuthorization ();\n\n    app.UseEndpoints (endpoints =\u003e\n    {\n        endpoints.MapControllers ();\n    });\n}\n```\n\n## Entidades\n![entidades](screen/2.png)\n\n## AutoMapper\n![entidades](screen/3.png)\n\n#\n![paulo barbosa](screen/face-notebook_300x292.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphjb%2Fproagil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphjb%2Fproagil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphjb%2Fproagil/lists"}