Code Monkey home page Code Monkey logo

visualstudio-projects-template's Introduction

Visual Studio Template for creating a new project

This project is a Visual Studio template for creating a new project. It is based on personal used and is not intended to be a one-size-fits-all solution. It is intended to be a starting point for a new project.

Any comment and suggestion are welcome. Please use the Discussions section to report any problem or to suggest any improvement.

Note This is individual maintained project. Maybe I will not be able to respond to all issues. But I will try to do my best.

Project is based on:

  • .NET 8.0
  • Use Serilog as logging system
  • Database-first design

Various project types including:

  • Console Application
  • Web API
  • Worker Service (Windows Service)

Dependencies

Thanks to the community, the template uses some dependencies to make the development process easier.

Concepts

Following we need to explain some concepts used in the template.

Serilog

The template uses Serilog as the logging system. It is a flexible and easy-to-use logging library for .NET. It is easy to configure and can be used in various scenarios.

Additional on Web API projects, the template uses Serilog.Enrichers.AspNetCore.RequestHeader to enrich the log with the request headers (currently support only correlationId).

Performance logging is also included in the template. It logs the duration of the request and the response status code. This job has job been done by PerformanceLoggingMiddleware class.

Database-first design

The template uses a database-first design. This means that the database is designed first and then the code is generated from the database. This is done using Entity Framework Core.

Currently, the template uses SQL Server as the database. The database is then imported into the project using the Scaffold-DbContext command.

I added some example commands usage in README-DbScaffold.md file. Only for reference.

Dependency Injection

The template uses dependency injection to manage the application's components. This is done using the built-in dependency injection system in .NET.

For more information, see Dependency injection in .NET.

Usage

To install the template, just copy files in folder export to the following directory:

%USERPROFILE%\Documents\Visual Studio 2022\Templates\ProjectTemplates

Note that you need to replace Visual Studio 2022 with the version of Visual Studio you are using.

Or run the following command in PowerShell to copy the files:

Copy-Item -Path .\export\* -Destination "$env:USERPROFILE\Documents\Visual Studio 2022\Templates\ProjectTemplates" -Recurse -Force

Note that you need to replace Visual Studio 2022 with the version of Visual Studio you are using.

Then, you can create a new project using the template in Visual Studio.

visualstudio-projects-template's People

Contributors

devildogtg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.