abp vnext倉儲模塊——對ado.net驅動的封裝實現。


abp vnext倉儲(Repository)模塊的代碼有對內存數據庫、EFCore ORM、mongodb等的封裝,但是沒有ADO.NET驅動的適配和封裝。有人有了解么?

 
又見阿郎的主頁 又見阿郎  初學一級 | 園豆:170
提問於:2020-02-17 09:29
評論 ]  
所有回答(1)
0

沒用過 abp vnext

EF就是對ASP.NET ADO 的封裝,感覺是支持的,具體怎么注入 綁定的要分析下源碼 EF就是那個樣子
abp vnext 太高級,對小白不友好,我自己寫了一個 目前用的還算合適,太高級對我來說不算友好

隨手貼一下
https://github.com/abpframework/abp/blob/dev/samples/DashboardDemo/src/DashboardDemo.EntityFrameworkCore/EntityFrameworkCore/DashboardDemoDbContext.cs

using Microsoft.EntityFrameworkCore; using DashboardDemo.Users; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.Modeling; using Volo.Abp.Users.EntityFrameworkCore; namespace DashboardDemo.EntityFrameworkCore { /* This is your actual DbContext used on runtime. * It includes only your entities. * It does not include entities of the used modules, because each module has already * its own DbContext class. If you want to share some database tables with the used modules, * just create a structure like done for AppUser. * * Don't use this DbContext for database migrations since it does not contain tables of the * used modules (as explained above). See DashboardDemoMigrationsDbContext for migrations. */ [ConnectionStringName("Default")] public class DashboardDemoDbContext : AbpDbContext<DashboardDemoDbContext> { public DbSet<AppUser> Users { get; set; } /* Add DbSet properties for your Aggregate Roots / Entities here. * Also map them inside DashboardDemoDbContextModelCreatingExtensions.ConfigureDashboardDemo */ public DashboardDemoDbContext(DbContextOptions<DashboardDemoDbContext> options) : base(options) { } protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); /* Configure the shared tables (with included modules) here */ builder.Entity<AppUser>(b => { b.ToTable("AbpUsers"); //Sharing the same table "AbpUsers" with the IdentityUser b.ConfigureFullAudited(); b.ConfigureExtraProperties(); b.ConfigureConcurrencyStamp(); b.ConfigureAbpUser(); //Moved customization to a method so we can share it with the DashboardDemoMigrationsDbContext class b.ConfigureCustomUserProperties(); }); /* Configure your own tables/entities inside the ConfigureDashboardDemo method */ builder.ConfigureDashboardDemo(); } } }


免責聲明!

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



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