{"id":21411355,"url":"https://github.com/cfrenzel/aspnetcore3apiverticalslice","last_synced_at":"2025-03-16T18:14:57.773Z","repository":{"id":69155840,"uuid":"291040496","full_name":"cfrenzel/AspNetCore3ApiVerticalSlice","owner":"cfrenzel","description":"Vertical Slice Architecture with Asp.net Core 3 Api Sample","archived":false,"fork":false,"pushed_at":"2020-08-28T18:34:29.000Z","size":39,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-23T04:43:17.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/cfrenzel.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-08-28T12:25:45.000Z","updated_at":"2025-01-20T04:55:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"d38c8d6b-afc7-4e07-8f2f-a476e3923e35","html_url":"https://github.com/cfrenzel/AspNetCore3ApiVerticalSlice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfrenzel%2FAspNetCore3ApiVerticalSlice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfrenzel%2FAspNetCore3ApiVerticalSlice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfrenzel%2FAspNetCore3ApiVerticalSlice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfrenzel%2FAspNetCore3ApiVerticalSlice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfrenzel","download_url":"https://codeload.github.com/cfrenzel/AspNetCore3ApiVerticalSlice/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910820,"owners_count":20367545,"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":[],"created_at":"2024-11-22T17:43:47.443Z","updated_at":"2025-03-16T18:14:57.753Z","avatar_url":"https://github.com/cfrenzel.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n \n \n- Uses a json file to seed an embedded sqlLite database.  Uses migrations to create the database on startup\n\n- Uses a **Vertical Slice** architecture to keep controller/model/handler logic isolated and in a single folder per operation\n   - Use MediatR for simple CQRS (command / query).  Also gives a great place to hook in pipelines\n     to perform any needed logic before or after handling a command/query (ex. validaton/logging/etc..)\n   \n   - Allows full control of model shape for every endpoint (or they can be shared if desired)\n  \t- api input/output excplicitly defined in a purpose built model per action \n        - no overposting\n        - clean interface between api models and efcore/entities\n        - can query using any technology for optimal performance\n            - efcore \n            - efcore with AutoMapper.QueryableExtensions (see List Handlers / ProjectTo)\n            - dapper for complex queries\n            - or even get data from a third party\n        - AutoMapper when needed to cleanly go between Entities and Models(Dto)\n\n   - We could add a more generic/advanced base response type to our handlers to get all kinds\n      of cool built-in behavior based on our needs\n      - A cleaner approach would be to return IActionResult from the handler.(decided to go with this on Create actions)\n        Your controllers would basically be empty! We could write a little miiddelware to avoid controllers completely :)\n        For now we'll keep it recogniizable as a conventional mvc app\n    \n- And\n   - Microsoft.AspNetCore.Mvc.Versioning - for flexible out of the box versioning\n   - Swagger configured to support for the above versioning \n   - FluentValidation\n   - Simple Paging\n   - Dependency Injection throughout\n   - https://github.com/khellang/Middleware - app.UseProblemDetails();\n        - for some good defaults around errors and debugging\n   - simple example of optimistic concurrency for the account transfer\n\n\n- To keep it simple from a REST perspective we're not being very strict or fancy\n    - No Authentication\n    - no nested resources\n    - Using \"actions\" / RPC like behavior when convenient\n    - Singular endpoint naming\n    - No HATEOAS\n    - No Content Negotiaton (though it would be easy to add)\n   \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfrenzel%2Faspnetcore3apiverticalslice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfrenzel%2Faspnetcore3apiverticalslice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfrenzel%2Faspnetcore3apiverticalslice/lists"}