• Stars
    star
    1,059
  • Rank 43,570 (Top 0.9 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

Authors

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

Common

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

Data

This solution folder contains three subfolders:

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

AspNetCoreTemplate.Data.Common

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

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

AspNetCoreTemplate.Data

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

Services

This solution folder contains four subfolders:

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

AspNetCoreTemplate.Services.Data

AspNetCoreTemplate.Services.Data wil contains service layer logic.

AspNetCoreTemplate.Services.Mapping

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>()
            .ForMember(
                source => source.Author,
                destination => destination.MapFrom(member => member.ApplicationUser.UserName));
    }
}

AspNetCoreTemplate.Services.Messaging

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

AspNetCoreTemplate.Services

AspNetCoreTemplate.Services

Tests

This solution folder contains three subfolders:

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

AspNetCoreTemplate.Services.Data.Tests

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

AspNetCoreTemplate.Web.Tests

AspNetCoreTemplate.Web.Tests setted up Selenuim tests.

Sandbox

Sandbox can be used to test your logic.

Web

This solution folder contains three subfolders:

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

AspNetCoreTemplate.Web.Infrastructure

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

AspNetCoreTemplate.Web.ViewModels

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

AspNetCoreTemplate.Web

AspNetCoreTemplate.Web self explanatory.

Support

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

Example Projects

License

This project is licensed with the MIT license.

More Repositories

1

OpenJudgeSystem

An open source system for online algorithm competitions for Windows, written in ASP.NET MVC
JavaScript
511
star
2

RatioMaster.NET

Ratiomaster.NET is a small standalone application which fakes upload and download stats of a torrent to almost all bittorrent trackers. This means that it does NOT rely on your bittorrent client (uTorrent, Azureus, BitComet, ABC and etc.) and it will NOT download/upload the files on a torrent - it only can fake download/upload. RatioMaster.NET has hardcoded emulations for the most commonly used BitTorrent clients: uTorrent, BitComet, Azureus, ABC, BitLord, BTuga, BitTornado, Burst, BitTyrant, BitSpirit.
C#
332
star
3

CSharpConsoleGames

Bunch of C# console games
C#
241
star
4

MusicX

Simple web music player built with Blazor WebAssembly
C#
155
star
5

TexasHoldemGameEngine

Texas Hold 'em Poker Game Engine
C#
129
star
6

PressCenters.com

News aggregator for the press releases of the Bulgarian government sites written in ASP.NET Core
CSS
104
star
7

nikolay.it

A simple blog system written in ASP.NET Core 5 and used for running https://nikolay.it
C#
83
star
8

ArtificialIntelligencePlayground

Repository for playing with AI and machine learning
C#
63
star
9

BelotGameEngine

Belot card game engine written in C#
Java
56
star
10

SantaseGameEngine

Santase card game engine
C#
46
star
11

CSharp-New-Features

Few samples to demonstrate the new features of the C# language (version 6.0 and 7.0)
C#
41
star
12

RestrictedProcess.NET

A small .NET library containing restricted process executor which can be used to run Windows programs with restricted rights. RestrictedProcess.NET can also limit the time and the memory of a running process.
C#
34
star
13

BgItJobsMarketShare

Bulgarian IT Jobs Technologies Market Share
C#
33
star
14

ASP.NET-MVC-5-Template

A ready-to-use template for ASP.NET MVC 5 with repositories, services, models mapping and DI and StyleCop warnings fixed.
JavaScript
31
star
15

RealTimeAppsDemo

Examples with real-time applications in ASP.NET Core (Polling, SSE, WebSockets, SignalR)
C#
30
star
16

MissingFeatures.NET

A .NET library containing some missing features in the .NET Framework
C#
26
star
17

css-exam-automation

Exam check automation for CSS
C#
18
star
18

TcecEvaluationBot

Chat bot for https://tcec-chess.com/
C#
15
star
19

NikolayIT

14
star
20

OOP-2015-Exam-Automation

Telerik Academy OOP Course 2015 Exam Automation
C#
14
star
21

GameAITesterOnline

Web portal for determining the best AI players for games
C#
12
star
22

Playing-with-G19-Keyboard

Repository with my attempts to write a widget for the Logitech G19 Keyboard LCD display
C#
12
star
23

ManagerTeams

Football manager simulation game. An old project (2005-2008) of mine written in PHP.
PHP
11
star
24

GradskiTransport

An old (2011) Windows Phone 7 project of mine. The application shows the nearest urban stations in Sofia and their arrival times.
C#
10
star
25

NStudio

An old (2007) project of mine. NStudio is a free (open source) editor that was written in C# on the .NET 2.0 Framework.
C#
9
star