{"id":25527142,"url":"https://github.com/estherslabbert/superhero.api","last_synced_at":"2026-05-07T10:36:05.515Z","repository":{"id":278444175,"uuid":"935634187","full_name":"EstherSlabbert/Superhero.Api","owner":"EstherSlabbert","description":"ASP.NET Web API SuperHero App using SqlServer database","archived":false,"fork":false,"pushed_at":"2025-02-25T11:21:21.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-22T01:37:39.271Z","etag":null,"topics":["asp-net","dotnet","dotnet8","entity-framework-core","sqlserver","web-api"],"latest_commit_sha":null,"homepage":"","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/EstherSlabbert.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":"2025-02-19T19:04:06.000Z","updated_at":"2025-02-25T11:21:32.000Z","dependencies_parsed_at":"2025-02-19T20:39:46.872Z","dependency_job_id":"8a4ec619-232c-4e2b-b87f-be7dcee0c7fa","html_url":"https://github.com/EstherSlabbert/Superhero.Api","commit_stats":null,"previous_names":["estherslabbert/superhero.api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/EstherSlabbert/Superhero.Api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EstherSlabbert%2FSuperhero.Api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EstherSlabbert%2FSuperhero.Api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EstherSlabbert%2FSuperhero.Api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EstherSlabbert%2FSuperhero.Api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EstherSlabbert","download_url":"https://codeload.github.com/EstherSlabbert/Superhero.Api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EstherSlabbert%2FSuperhero.Api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271092128,"owners_count":24697903,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["asp-net","dotnet","dotnet8","entity-framework-core","sqlserver","web-api"],"created_at":"2025-02-19T22:17:16.764Z","updated_at":"2026-05-07T10:36:05.474Z","avatar_url":"https://github.com/EstherSlabbert.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Superhero API Web App\n\nASP.NET Web API SuperHero App using SqlServer database.\n\nThis app enables you to track basic information about superheroes in a Sql Server database and manages this via an API that makes use of controllers and manages data via EntityFrameworkCore (the recommended Object-Relational Mapper (ORM) for .NET).\n\n## Initial set up and discovery\n\n1. Create a new project with VisualStudio selecting the following settings:\n\n   Template: ASP.NET Core Web API\n\n   Name: Whatever you want to name your project\n\n   Framework: .NET 8.0 (Long Term Support)\n\n   Authentication: None\n\n   - [x] Configure for HTTPS\n   - [ ] Enable container support\n   - [x] Enable OpenApi support\n   - [ ] Do not use top level statements\n   - [x] Use controllers\n   - [ ] Enlist in .NET Aspire orchestration\n\n2. Use NuGet Package Manager to install:\n\n   - Microsoft.EntityFrameworkCore.SqlServer (Version 8.0.0)\n   - Microsoft.EntityFrameworkCore.Tools (Version 8.0.0)\n\n3. Set up a new entity (in this project, a class called `SuperHero`) with the necessary properties.\n4. Add a new controller for getting all the superheroes with dummy data to return from the controller itself as a placeholder for now.\n5. Set up your `DataContext` file, which creates a class that inherits from `DbContext` and add your context options to the constructor and a new table in the form of `DbSet\u003cSuperHero\u003e`.\n6. Set your connection strings in the `appsettings.json` file.\n7. Update `Program.cs` file with the database context like follows:\n\n   ```csharp\n        builder.Services.AddDbContext\u003cDataContext\u003e(options =\u003e\n   {\n   options.UseSqlServer(builder.Configuration.GetConnectionString(\"DefaultConnection\"));\n   });\n   ```\n\n8. Open the Package Manager Console and enter the following commands:\n\n   `Add-Migration Initial` Initial is the name of the migration that will be automatically generated and stored in the Migrations folder\n\n   then `Update-Database` which applies the migrations to the database.\n\n   Note: These commands ensure the database has the needful table(s) and when new tables need to be added similar commands need to be run from the Package Manager Console `Add-Migration NameOfMigration` then `Update-Database` (to do the update on a specific migration you need to use the `Update-Database NameOfMigration`) OR via the command line once ef tool is installed using `dotnet tool install --global dotnet-ef` command, then `dotnet ef migrations add AddUnhandledExceptionTable --project Superhero --startup-project Superhero` then `dotnet ef database update`. See [LearnEntityFrameworkCore](https://www.learnentityframeworkcore.com/) for more details.\n\n9. Now set up the controller to use the database with the DataContext as an entry point. Get the controller working as desired then add other controllers for CRUD operations.\n10. Clean up unneeded files.\n11. Separate out files and methods into projects as dependency injections and services to be used etc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festherslabbert%2Fsuperhero.api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Festherslabbert%2Fsuperhero.api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Festherslabbert%2Fsuperhero.api/lists"}