Address: https: //aspnetboilerplate.com/Pages/Documents
What is ASP.NET model?
ASP.NET Boilerplate (ABP) is an open source and fully document application framework. It is not only a framework, but also provides a powerful architecture model based on domain-driven design, taking into account all of the best practices.
ABP used with the latest ASP.NET Core and EF Core, but also supports ASP.NET MVC 5.x and EF6.x.
A Quick Sample
Let's investigate a simple class to see ABP's benefits:
Let's look at a simple class to understand the benefits of ABP:
public class TaskAppService : ApplicationService, ITaskAppService { private readonly IRepository<Task> _taskRepository; public TaskAppService(IRepository<Task> taskRepository) { _taskRepository = taskRepository; } [AbpAuthorize(MyPermissions.UpdateTasks)] public async Task UpdateTask(UpdateTaskInput input) { Logger.Info("Updating a task for input: " + input); var task = await _taskRepository.FirstOrDefaultAsync(input.TaskId); if (task == null) { throw new UserFriendlyException(L("CouldNotFindTheTaskMessage")); } ObjectMapper.MapTo(input, task); } }
Here, we see a sample application service method. The presentation layer is performed by an application in an application service used directly in DDD. The UpdateTask deemed JavaScript method called through AJAX.
Let's see here some of the benefits of ABP:
Dependency Injection:
ABP to use and provide regular DI infrastructure. Because this is an application service, which is registered as it is often transient (created upon request) to the DI container. It can simply inject any dependencies (e.g. in this example IRepository <Task>).
Repository:
ABP can create a default storage (e.g. in this example IRepository <Task>) for each entity. Default repository have many useful methods, e.g. FirstOrDefault methods used in this example. We can extend the default repository to meet our needs. Abstract repository DBMS and ORM, and simplifies the data access logic.
Authorization:
ABP can declare check permissions. If the current user does not have "Update Tasks" permission or not logged on, it blocks access to UpdateTask method. ABP not only declarative attributes, but also has other unauthorized manner.
verification:
ABP automatically checks whether the input is empty. It is also based on the standard data annotation attributes and all attributes custom validation rules to validate input. If the request is invalid, it throws an appropriate exception handling authentication at the client.
Audit Logging:
User, browser, IP address, service calls, methods, parameters, call time, duration, and perform some other information will be automatically saved for each request by convention and configuration.
Unit of work:
In ABP, the default method for each application services are assumed to be the work unit. It automatically creates a connection and start a transaction when the method begins. If the process is completed successfully, without exception, will commit the transaction and release the connection. This method uses even different repositories or a method, which will be atoms (transactional). After the transaction is committed, it will automatically save all changes to the entity. We do not even call shown above _repository.Update (task) method.
Exception Handling:
We almost do not need to manually handle exceptions in the ABP Web application. By default, all exceptions are handled automatically! If an exception occurs, ABP will automatically log the exception and the right results back to the client. For example, if this is an AJAX request, it returns to the client a JSON object, indicating an error. Unless used in this example is UserFriendlyException abnormal, otherwise it will hide the actual exception to the client. It also understand and deal with client error, appropriate message is displayed to the user.
Logging:
As you can see, we can write the log using the Logger object defined in the base class. Log4Net used by default, but can be changed and it is configurable.
Localization:
Please note that when an exception is thrown we use "L" method? In this way, it will automatically localized based on the current user's culture. For more information, see the localized documentation.
Automatic Mapping:
In the last line, we use IObjectMapper of ABP MapTo method of mapping input. Attributes to entity attributes. It uses AutoMapper library to perform the mapping. We can easily attribute mapping according to the naming convention from one object to another.
Dynamic API layer:
In fact, TaskAppService is a simple class. In general, we have to write a wrapper API to control methods to JavaScript clients, but ABP performed automatically at runtime. In this way, we can use the method of application services directly from the client.
Evaluation: Good Advanced ah ..................
Dynamic JavaScript AJAX proxy:
ABP create a proxy method, the calling application service method is as simple as calling a JavaScript method on the client.
We can see the benefits of ABP in this simple class. All of these tasks often spend a lot of time, but will be handled automatically by the framework.
In addition to this simple example, ABP also modular, multi-tenant, caching, background jobs, data filters, settings management, field events, unit and integration testing provides a powerful infrastructure and development model. You focus on your business codes do not repeat yourself!
getting Started
You can start from a template or start a tutorial that introduces.
Startup Templates
Directly create a modern looking startup project from the startup templates.
Create the appearance of modern boot directly from the project start template.
Start templates provide the basic layout and some common functionality to your application. There are several different options have to start template.
ASP.NET Core
- Single Page Application with ASP.NET Core & Angular
- Multi-Page Application with ASP.NET Core & jQuery
ASP.NET MVC 5.x
See the download page for other combinations.
For additional combinations, see the download page.
Introduction Tutorials (Start Tutorial)
Step by step tutorials introduces the framework and explains how to create your application based on the startup templates.
Step by step tutorial introduces the framework, and explains how to create an application-based startup template.
ASP.NET Core
- Introduction with ASP.NET Core & Entity Framework Core
- Developing a multi-tenant (SaaS) application with ASP.NET Core, EntityFramework Core & Angular
ASP.NET MVC 5.x
- Introduction with ASP.NET MVC 5.x, Web API 2.x, EntityFramework 6.x & AngularJS 1.x
- Developing a multi-tenant (SaaS) application with ASP.NET MVC 5.x, EntityFramework 6.x & AngularJS 1.x
The Samples (Samples example)
There are many sample projects developed with the framework. See the samples page.
The framework developed a number of example projects. See the examples page.
Community (Community)
This is an open source project and open to contributions from the community.
This is an open source project, welcomed the contribution of the community.
- Use the GitHub repository to access the latest source code, create issues and send pull requests.
- Use aspnetboilerplate tag on stackoverflow to ask questions about the usage.
- Follow aspboilerplate on twitter to be informed about the happenings.
- Use GitHub repository access the latest source code that creates the problem and send a pull request.
- Use aspnetboilerplate mark on stackoverflow to ask questions about usage.
- Aspboilerplate attention on Twitter, in order to understand the situation.
Summary: This is the first page of the document content translation, content, and the second article:
very similar. The first page of the document introduces a bit Content:
1, said the concept of abp;
2, give a code sample, include the benefits of using the code according to exemplary abp;
3, which lists the abp provides templates;
4, citing a connection introductory tutorial, you can start learning abp according introductory tutorial step by step;
5, lists exemplary project url addresses;
6, introduced community-related information, can participate in the development of abp. Project on github.
ABP to use and provide regular DI infrastructure. Because this is an application service, which is registered as it is often transient (created upon request) to the DI container. It can simply inject any dependencies (e.g. in this example IRepository <Task>).
Repository:
ABP can create a default storage (e.g. in this example IRepository <Task>) for each entity. Default repository have many useful methods, e.g. FirstOrDefault methods used in this example. We can extend the default repository to meet our needs. Abstract repository DBMS and ORM, and simplifies the data access logic.
Authorization:
ABP can declare check permissions. If the current user does not have "Update Tasks" permission or not logged on, it blocks access to UpdateTask method. ABP not only declarative attributes, but also has other unauthorized manner.
verification:
ABP automatically checks whether the input is empty. It is also based on the standard data annotation attributes and all attributes custom validation rules to validate input. If the request is invalid, it throws an appropriate exception handling authentication at the client.
Audit Logging:
User, browser, IP address, service calls, methods, parameters, call time, duration, and perform some other information will be automatically saved for each request by convention and configuration.
Unit of work:
In ABP, the default method for each application services are assumed to be the work unit. It automatically creates a connection and start a transaction when the method begins. If the process is completed successfully, without exception, will commit the transaction and release the connection. This method uses even different repositories or a method, which will be atoms (transactional). After the transaction is committed, it will automatically save all changes to the entity. We do not even call shown above _repository.Update (task) method.
Exception Handling:
We almost do not need to manually handle exceptions in the ABP Web application. By default, all exceptions are handled automatically! If an exception occurs, ABP will automatically log the exception and the right results back to the client. For example, if this is an AJAX request, it returns to the client a JSON object, indicating an error. Unless used in this example is UserFriendlyException abnormal, otherwise it will hide the actual exception to the client. It also understand and deal with client error, appropriate message is displayed to the user.
Logging:
As you can see, we can write the log using the Logger object defined in the base class. Log4Net used by default, but can be changed and it is configurable.
Localization:
Please note that when an exception is thrown we use "L" method? In this way, it will automatically localized based on the current user's culture. For more information, see the localized documentation.
Automatic Mapping:
In the last line, we use IObjectMapper of ABP MapTo method of mapping input. Attributes to entity attributes. It uses AutoMapper library to perform the mapping. We can easily attribute mapping according to the naming convention from one object to another.
Dynamic API layer:
In fact, TaskAppService is a simple class. In general, we have to write a wrapper API to control methods to JavaScript clients, but ABP performed automatically at runtime. In this way, we can use the method of application services directly from the client.
Evaluation: Good Advanced ah ..................
Dynamic JavaScript AJAX proxy:
ABP create a proxy method, the calling application service method is as simple as calling a JavaScript method on the client.