AspNetCoreTemplate 5.0.6

There is a newer version of this package available.
See the version list below for details.
dotnet new install AspNetCoreTemplate::5.0.6
This package contains a .NET Template Package you can call from the shell/command line.

ASP.NET Core Template

A ready-to-use template for ASP.NET Core with repositories, services, models mapping, DI and StyleCop warnings fixed.

Build status

Build Status


Package Installation

You can install this template using NuGet:

dotnet new -i AspNetCoreTemplate
dotnet new aspnet-core -n YourProjectName

Pack this Template

dotnet pack .\nuget.csproj

Project Overview

Dependencies Graph image


AspNetCoreTemplate.Common contains common things for the project solution. For example:


This solution folder contains three subfolders:

  • AspNetCoreTemplate.Data.Common
  • AspNetCoreTemplate.Data.Models
  • AspNetCoreTemplate.Data

AspNetCoreTemplate.Data.Common.Models provides abstract generics classes and interfaces, which holds information about our entities. For example when the object is Created, Modified, Deleted or IsDeleted. It contains a property for the primary key as well.

AspNetCoreTemplate.Data.Common.Repositories provides two interfaces IDeletableEntityRepository and IRepository, which are part of the repository pattern.


AspNetCoreTemplate.Data.Models contains ApplicationUser and ApplicationRole classes, which inherits IdentityRole and IdentityUsers.


AspNetCoreTemplate.Data contains DbContext, Migrations and Configuraitons for the EF Core.There is Seeding and Repository functionality as well.


This solution folder contains four subfolders:

  • AspNetCoreTemplate.Services.Data
  • AspNetCoreTemplate.Services.Mapping
  • AspNetCoreTemplate.Services.Messaging
  • AspNetCoreTemplate.Services

AspNetCoreTemplate.Services.Data wil contains service layer logic.


AspNetCoreTemplate.Services.Mapping provides simplified functionlity for auto mapping. For example:

using Blog.Data.Models;
using Blog.Services.Mapping;

public class TagViewModel : IMapFrom<Tag>
    public int Id { get; set; }

    public string Name { get; set; }

Or if you have something specific:

using System;

using AutoMapper;
using Blog.Data.Models;
using Blog.Services.Mapping;

public class IndexPostViewModel : IMapFrom<Post>, IHaveCustomMappings
    public int Id { get; set; }

    public string Title { get; set; }

    public string Author { get; set; }

    public string ImageUrl { get; set; }

    public DateTime CreatedOn { get; set; }

    public void CreateMappings(IProfileExpression configuration)
        configuration.CreateMap<Post, IndexPostViewModel>()
                source => source.Author,
                destination => destination.MapFrom(member => member.ApplicationUser.UserName));


AspNetCoreTemplate.Services.Messaging a ready to use integration with SendGrid.




This solution folder contains three subfolders:

  • AspNetCoreTemplate.Services.Data.Tests
  • AspNetCoreTemplate.Web.Tests
  • Sandbox

AspNetCoreTemplate.Services.Data.Tests holds unit tests for our service layer with ready setted up xUnit.


AspNetCoreTemplate.Web.Tests setted up Selenuim tests.


Sandbox can be used to test your logic.


This solution folder contains three subfolders:

  • AspNetCoreTemplate.Web.Infrastructure
  • AspNetCoreTemplate.Web.ViewModels
  • AspNetCoreTemplate.Web

AspNetCoreTemplate.Web.Infrastructure contains functionality like Middlewares and Filters.


AspNetCoreTemplate.Web.ViewModels contains objects, which will be mapped from/to our entities and used in the front-end/back-end.


AspNetCoreTemplate.Web self explanatory.


If you are having problems, please let us know by raising a new issue.

Example Projects


This project is licensed with the MIT license.

  • net5.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
7.0.3 788 2/25/2023
6.0.5 1,003 6/7/2022
6.0.3 598 3/30/2022
5.0.6 3,062 5/18/2021
5.0.1 976 12/19/2020
5.0.0 530 12/6/2020
1.0.1 942 10/26/2020
1.0.0 402 10/25/2020