Skip to content

Commit b434c95

Browse files
authored
Merge pull request #67 from StoyanShopov/feature/new-readme
Feature/new readme
2 parents e3f2c4d + a73b50f commit b434c95

File tree

1 file changed

+154
-0
lines changed

1 file changed

+154
-0
lines changed

README.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,157 @@ A ready-to-use template for ASP.NET Core with repositories, services, models map
1010

1111
- [Nikolay Kostov](https://github.com/NikolayIT)
1212
- [Vladislav Karamfilov](https://github.com/vladislav-karamfilov)
13+
14+
## Package Installation
15+
16+
You can install this template using [NuGet](https://www.nuget.org/packages/AspNetCoreTemplate):
17+
18+
```powershell
19+
dotnet new --install AspNetCoreTemplate
20+
```
21+
22+
```powershell
23+
dotnet new aspnet-core-template -n YourProjectName
24+
```
25+
26+
## Project Overview
27+
28+
![Dependencies Graph](https://user-images.githubusercontent.com/25417032/97107966-0e5fc500-16d3-11eb-9b9c-c73012ff97ac.png)
29+
![image](https://user-images.githubusercontent.com/25417032/97108063-9fcf3700-16d3-11eb-8225-32eac21c4542.png)
30+
31+
### Common
32+
33+
**AspNetCoreTemplate.Common** contains common things for the project solution. For example:
34+
- [GlobalConstants.cs](https://github.com/NikolayIT/ASP.NET-Core-Template/blob/master/src/AspNetCoreTemplate.Common/GlobalConstants.cs).
35+
36+
### Data
37+
This solution folder contains three subfolders:
38+
- AspNetCoreTemplate.Data.Common
39+
- AspNetCoreTemplate.Data.Models
40+
- AspNetCoreTemplate.Data
41+
42+
#### AspNetCoreTemplate.Data.Common
43+
44+
[AspNetCoreTemplate.Data.Common.Models](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/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.
45+
46+
[AspNetCoreTemplate.Data.Common.Repositories](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Data/AspNetCoreTemplate.Data.Common/Repositories) provides two interfaces IDeletableEntityRepository and IRepository, which are part of the **repository pattern**.
47+
48+
#### AspNetCoreTemplate.Data.Models
49+
[AspNetCoreTemplate.Data.Models](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Data/AspNetCoreTemplate.Data.Models) contains ApplicationUser and ApplicationRole classes, which inherits IdentityRole and IdentityUsers.
50+
51+
#### AspNetCoreTemplate.Data
52+
[AspNetCoreTemplate.Data](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Data/AspNetCoreTemplate.Data) contains DbContext, Migrations and Configuraitons for the EF Core.There is Seeding and Repository functionality as well.
53+
54+
### Services
55+
This solution folder contains four subfolders:
56+
- AspNetCoreTemplate.Services.Data
57+
- AspNetCoreTemplate.Services.Mapping
58+
- AspNetCoreTemplate.Services.Messaging
59+
- AspNetCoreTemplate.Services
60+
61+
#### AspNetCoreTemplate.Services.Data
62+
[AspNetCoreTemplate.Services.Data](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Services/AspNetCoreTemplate.Services.Data) wil contains service layer logic.
63+
64+
#### AspNetCoreTemplate.Services.Mapping
65+
[AspNetCoreTemplate.Services.Mapping](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Services/AspNetCoreTemplate.Services.Mapping) provides simplified functionlity for auto mapping. For example:
66+
67+
```csharp
68+
using Blog.Data.Models;
69+
using Blog.Services.Mapping;
70+
71+
public class TagViewModel : IMapFrom<Tag>
72+
{
73+
public int Id { get; set; }
74+
75+
public string Name { get; set; }
76+
}
77+
```
78+
79+
Or if you have something specific:
80+
81+
```csharp
82+
using System;
83+
84+
using AutoMapper;
85+
using Blog.Data.Models;
86+
using Blog.Services.Mapping;
87+
88+
public class IndexPostViewModel : IMapFrom<Post>, IHaveCustomMappings
89+
{
90+
public int Id { get; set; }
91+
92+
public string Title { get; set; }
93+
94+
public string Author { get; set; }
95+
96+
public string ImageUrl { get; set; }
97+
98+
public DateTime CreatedOn { get; set; }
99+
100+
public void CreateMappings(IProfileExpression configuration)
101+
{
102+
configuration.CreateMap<Post, IndexPostViewModel>()
103+
.ForMember(
104+
source => source.Author,
105+
destination => destination.MapFrom(member => member.ApplicationUser.UserName));
106+
}
107+
}
108+
109+
```
110+
111+
#### AspNetCoreTemplate.Services.Messaging
112+
113+
[AspNetCoreTemplate.Services.Messaging](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Services/AspNetCoreTemplate.Services.Messaging) a ready to use integration with [SendGrid](https://sendgrid.com/).
114+
115+
#### AspNetCoreTemplate.Services
116+
[AspNetCoreTemplate.Services](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Services/AspNetCoreTemplate.Services)
117+
118+
### Tests
119+
This solution folder contains three subfolders:
120+
- AspNetCoreTemplate.Services.Data.Tests
121+
- AspNetCoreTemplate.Web.Tests
122+
- Sandbox
123+
124+
#### AspNetCoreTemplate.Services.Data.Tests
125+
126+
[AspNetCoreTemplate.Services.Data.Tests](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Tests/AspNetCoreTemplate.Services.Data.Tests) holds unit tests for our service layer with ready setted up xUnit.
127+
128+
#### AspNetCoreTemplate.Web.Tests
129+
130+
[AspNetCoreTemplate.Web.Tests](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Tests/AspNetCoreTemplate.Web.Tests) setted up Selenuim tests.
131+
132+
#### Sandbox
133+
[Sandbox](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Tests/Sandbox) can be used to test your logic.
134+
135+
### Web
136+
This solution folder contains three subfolders:
137+
- AspNetCoreTemplate.Web.Infrastructure
138+
- AspNetCoreTemplate.Web.ViewModels
139+
- AspNetCoreTemplate.Web
140+
141+
#### AspNetCoreTemplate.Web.Infrastructure
142+
143+
[AspNetCoreTemplate.Web.Infrastructure](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Web/AspNetCoreTemplate.Web.Infrastructure) contains functionality like Middlewares and Filters.
144+
145+
#### AspNetCoreTemplate.Web.ViewModels
146+
147+
[AspNetCoreTemplate.Web.ViewModels](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Web/AspNetCoreTemplate.Web.ViewModels) contains objects, which will be mapped from/to our entities and used in the front-end/back-end.
148+
149+
#### AspNetCoreTemplate.Web
150+
151+
[AspNetCoreTemplate.Web](https://github.com/NikolayIT/ASP.NET-Core-Template/tree/master/src/Web/AspNetCoreTemplate.Web) self explanatory.
152+
153+
## Support
154+
155+
If you are having problems, please let us know by [raising a new issue](https://github.com/NikolayIT/ASP.NET-Core-Template/issues).
156+
157+
## Contributors
158+
- [Stoyan Shopov](https://github.com/StoyanShopov)
159+
160+
## Example Projects
161+
- https://github.com/NikolayIT/PressCenters.com
162+
- https://github.com/NikolayIT/nikolay.it
163+
164+
## License
165+
166+
This project is licensed with the [MIT license](LICENSE).

0 commit comments

Comments
 (0)