ABP的新舊版本選型


新版本  (abp vnext )

https://www.abp.io/

ABP是一個開源的應用程序框架ASP.NET基於核心的web應用程序開發,也支持開發其他類型的應用程序。

對舊版本的重寫,基於ASP.NET CORE,主要定位微服務;

//Base class for CRUD services
public class PeopleAppService
    : CrudAppService<Person, PersonDto, Guid>,
      IPeopleAppService
{
    //Generic repository
    public PeopleAppService(
        IRepository<Person, Guid> repository
    ) : base(repository)
    {
    }
}

  

 

舊版本 (AspNet Boilerplate)   

https://aspnetboilerplate.com/

ASP.NET樣板(Boilerplate,ABP)是一個開源的、有良好文檔記錄的應用程序框架。它不僅僅是一個框架,它還提供了一個基於領域驅動設計的強大的體系結構模型,並考慮了所有的最佳實踐。

ABP與最新的ASP.NETCore和EF Core,但也支持ASP.NETMVC5.x和EF6.x。

基於Core和framework ;穩定和長期維護;

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);
    }
}

  

 

選型

如果已經使用舊版本,而且沒有微服務需求,可以繼續使用;

如果是全新的項目,建議直接使用新版的,畢竟新版的才是未來的趨勢;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM