GithubHelp home page GithubHelp logo

bubdm / asp.net-core-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nikolayit/asp.net-core-template

0.0 0.0 0.0 8.34 MB

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

License: MIT License

C# 89.02% CSS 1.65% JavaScript 0.26% HTML 9.06%

asp.net-core-template's Introduction

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.

asp.net-core-template's People

Contributors

danisio avatar dependabot[bot] avatar georgimanov avatar iliyanang avatar kristianmariyanov avatar mariyasteffanova avatar nikolayit avatar pawelangelow avatar stanislavstoyanov99 avatar stoyanshopov avatar todorm85 avatar viktorrr avatar vladislav-karamfilov 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.