devadventures-net-core-template icon indicating copy to clipboard operation
devadventures-net-core-template copied to clipboard

A Visual Studio extension that provides a robust and maintainable setup for a .NET Core API.

This template is available in the Visual Studio Marketplace. Also make sure to check out the sample RealWorld app.

After installing the VSIX you will see the template available under Visual C#:

template-in-vs

To get familiar with the Maybe and Either monads you can take a look at the introductory Option article, real life examples of Either in C# and the template introductory article.


Features

Web API

  • [x] AutoMapper
  • [x] EntityFramework Core with SQL Server and ASP.NET Identity
  • [x] JWT authentication/authorization
  • [x] File logging with Serilog
  • [x] Stylecop
  • [x] Neat folder structure
├───src
│   ├───configuration
│   └───server
│       ├───MyProject.Api
│       ├───MyProject.Business
│       ├───MyProject.Core
│       ├───MyProject.Data
│       └───MyProject.Data.EntityFramework
└───tests
    └───MyProject.Business.Tests

  • [x] Swagger UI + Fully Documented Controllers

swagger-ui

  • [x] Global Model Errors Handler

model-errors

  • [x] Global Environment-Dependent Exception Handler
    Development
    exception-development
    Production
    enter image description here
  • [x] Neatly organized solution structure
    solution-structure
  • [x] Thin Controllers
    thin-controllers
  • [x] Robust service layer using the Either monad.
    either-monad
  • [x] Safe query string parameter model binding using the Option monad.
    optional-binding

Test Suite

  • [x] xUnit
  • [x] Autofixture
  • [x] Moq
  • [x] Shouldly
  • [x] Arrange Act Assert Pattern

test-suite