abp vnext仓储(Repository)模块的代码有对内存数据库、EFCore ORM、mongodb等的封装,但是没有ADO.NET驱动的适配和封装。有人有了解么?
EF就是对ASP.NET ADO 的封装,感觉是支持的,具体怎么注入 绑定的要分析下源码 EF就是那个样子
abp vnext 太高级,对小白不友好,我自己写了一个 目前用的还算合适,太高级对我来说不算友好
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();
}
}
}
你这个示例代码应该还是EF把。有没有就是仓储层是基于ado.net,而不是ef或是efcore去操作数据库。