As .Net core(version used here is 2.1) is becoming popular day by day, here are some projects I created which might come handy. (added comments in the code for better understanding). Whichever functionality you want to test just set those web API project as startup project and you are good to go.
In this project, we moved all the service injection logic to a different class. We should avoid putting all service injection logic inside ConfigureServices method. Also when we are using .Net core with the client-side project like Angular or react we should take care of cors issue as well.
Project Name: BasicProjectSetup
This project contains an implementation of logging feature provided by default with .Net core.
Project Name: LoggingImplementation
This project contains 2 things:
a. How to Entity framework with SQL server
b. Implementation via Repository design pattern
Nugets used: Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Tools (Project: EFImplementation.Repository)
Folder Name: EFImplementation
refer this for more understanding of EF implementation in .Net core
This project contains 3 things:
a. Custom Log implementation by extending NLog.Extensions.Logging
b. Built in .Net core middleware implementation
c. Custom middleware implementation
Folder Name: Errorhandling
Nugets usd: NLog.Extensions.Logging(Project: LoggerService)
This project contains swagger implementation.
Project Name: SwaggerImplementation
Nuget used: Swashbuckle.AspNetCore(Project: SwaggerImplementation)
This project helps in understanding how XUnit framework works.
Folder Name: XUnitTest
Nuget used: Microsoft.AspNetCore.App(Project: Learn.UnitTest)
- Refernce article
Please share your valuable feedback, as it will help me write better :)