Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Clean Architecture of AspNetCore Api
Clean Architecture of AspNetCore Api

Clean Architecture of AspNetCore Api

Ajay Ojha

|
2,690 installs
| (1) | Free
A template solution for building RESTful API's with good design patterns and practices for enterprise application.
Download

A solution template can be used for building an enterprise application on Asp.Net Core APIs. This follows the practices of Clean Architecture, Domain-Driven Design Practices as well as considers the OWASP Top Security Standards and performance practices which are suggested by Microsoft.

What's the objective of providing Clean Architecture Template?

The overall objective is to design the Clean Architecture template which extends the AspNetCore feature in an optimum way. As Asp.Net Core is a top-class framework and this provides a lot of things. But when we talk about the enterprise application then the plain Scaffold template won't work, Because we need one robust architecture that takes care of the application security, performance, necessary patterns, RESTful Design Practices, and topmost principles/practices along with good coding conventions, modularity, maintainability, and extensibility. It's a bit clumsy and confusing task (As per me 😃).

This is just a start for providing all these things in the one template solution of RxWeb Clean Architecture of AspNetCore Api. We can enhance the base template and do the necessary changes as and when required. You can share your exemplary inputs on the GitHub repo or feel free to make a pull request for the betterment of the template. This helps others too 👍.

What is something different?

Have a look at the below code, then after will talk in detail 😃 :

Untitled__2.png

Attributes are a powerful feature in the C#, This gives the biggest benefit of re-usability, rapid development and code look cleaner, Because we don't need to create multiple classes to handle every specific task like entity validation, timezone management, value conversion, etc. This is one of the key area in this template, there are lots of other things are implemented in a nice and structured way.

How to?

Project_template__1.png

Examine the project structure

As RxWeb follows the practices of Clean Architecture, Based upon this the project structure is divided into several layers of Models, Domain services, Bounded context, Application core and API which adds the practices of separation of concerns for simplification and maintainable code.

solution.png

ProjectDescription
ModelsThe primary purpose of this project is to define POCO models,Enums,Interfaces which can be used application wide or you can define the extended models.
BoundedContextThis project contains DbContexts which are made based upon the defined modules which can work independently based upon its concept.
UnitOfWorkThis project contains Uow class for its respective BoundedContext to follow repository pattern which provides methods through which the data can be manipulated.
InfrastructureThis project covers necessary implemetations used for performing centralized operations like determining user access and access permission, email and sms provider, authorize token etc
DomainDomain project contains Domain services which are made whenever high complexity APIs are made. You can define domain class in which can add your custom business logic.
ApiThe Api project is the .Net core based web application which is the start of the project. It contains application settings, Controllers, necessery injected services like security, performance etc. The Api controllers are made in this project.

How many features are included in the template without writing the extra line of code?

  1. OWASP Security Practices
  2. Performance Pattern and Practices
  3. Authentication
  4. Authorization
  5. Multitenancy (Same Database Column Based, Schema Based and Multiple Database)
  6. Multilingual
  7. Data Validation
  8. Data Sanitization
  9. Exception Handling
  10. Logging
  11. Centralized Global Data Filtering
  12. Many more...

What about the Scaffolding after project creation?

You can use the rxwebcore cli for scaffolding. This provides so many things by executing a single line of command. By using the rxwebcore cli this gives a benefit for the simplification and maintainable of the application as well as you can focus on the business logic part only instead of creating multiple files and reference them accordingly.

This will generate the classes/referencing the object according to the principles/practices of :

  1. Domain-Driven Design Practices
  2. Bounded Context Pattern
  3. Unit Of Work Pattern
  4. Repository Pattern
  5. Command Query Responsibility Segregation
  6. Single Responsibility Principle
  7. LIFT Practices
  8. Inversion Of Control
  9. Interface Segregation Principle
  10. Many More...

This will generate the following things:

  1. Controller
  2. Domain Service Class
  3. Bounded Context
  4. Unit Of Work Layer
  5. POCO Models
  6. Enums
  7. Lot more...

If you have any suggestions in the template, please share .

The documentation work is going on as well as the template up-gradation. If you have any question feel to join the [rxweb gitter channel] (https://gitter.im/rxweb-project/rxweb)

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft