ASP.NET RESTful Service Project Template (Web API 2) (edit)
- CORS enabled
- preconfigured HTTP OPTIONS handler
- preconfigured Cache-Control header to disable caching
- Autofac as a DI-container
- Content formatter configured to use Json.Net
- Unhandled exceptions handler
- Unhandled exceptions logger
- Serilog as a default logger preconfigured to save logs to %AppData%/Logs folder
- Swagger for API documentation
- JWT-Bearer authentication to protect your API with IdentityModel
- Ability to use environment variables in configuration options (web.config)
- Support .env files to easy switching between different environments (DotNetEnv)
ASP.NET Core RESTful Service Project Template
The repository contains a ready to use pre-configured project template for MS Visual Studio 2017 and 2019 to create fully functional production-ready cross-platform RESTful services based on ASP.Net Core 2.1.
This template is intended to provide you an almost all that you need for creating RESTful services. The project doesn't contain any UI stuff, like React or Angular libraries, npm, Razor views, as well as any problem domain specific things like EntityFramework, some "right" or "neat" project structure or even a number of projects, each for the specific purpose (for example, service itself, domain logic, data access, testing and so on) as does it some other templates. There are too many areas where ASP.Net Core services can be used, so it hardly can be offered anything related to domain areas to fit all of these project types.
However, some things must be implemented or configured in almost each of the projects, regardless of the subject area. Among these things are dependency injection, exception handling, logging, and others. There are many libraries and solutions to address each of them, but it is impossible to choose a set that fits absolutely everyone. In this project, I have collected the solutions that I consider the most convenient and use them for years in almost each of my projects. I hope you will like them too :). So, the project contains these the most important features, but is not limited to them:
- CORS and preflight requests support
- Autofac as a DI-container
- Serilog as a default preconfigured logger
- Unhandled exceptions handling
- Swashbuckle for API documentation
- Ability to use environment variables in configuration options and support for '.env' files to easy switching between different environments (thanks to DotNetEnv)
- ... and some boilerplate code
ASP.NET Providers Connected Service
Configure providers for your ASP.NET web application to work with Azure services.
Provider pattern was introduced in ASP.NET 2.0 and it gives the developers the flexibility of where to store the state of ASP.NET features (e.g. Session State, Membership, Output Cache etc.). In ASP.NET 4.6.2, we added async support for Session State Provider and Output Cache Provider. These providers provide much better scalability, and enables the web application to adapt to the cloud environment. Furthermore, , we also released SqlSessionStateProviderAsync, CosmosDBSessionStateProviderAsync, RedisSessionStateProvider and SQLAsyncOutputCacheProvider. Through these providers the web applications can store the Session State in Azure resources like, Azure SQL Database, Azure Cosmos DB, and Azure Redis Cache, and Output Cache in Azure SQL Database. With these options, it may be not very straightforward to pick one and configure it right in the application. ASP.NET Providers Connected Service Visual Studio Extension will help you pick the right provider and configure it properly to work with Azure resources. This extension will be your one-stop shop where you can install and configure all the ASP.NET providers that are Azure ready.