← ClaudeAtlas

abp-efcorelisted

ABP Framework v10.4 Entity Framework Core: AbpDbContext, ConfigureByConvention, AddAbpDbContext, repository (EfCoreRepository), migration, PostgreSQL/MySQL/SQLite/Oracle. Use when working with EF Core, DbContext, migrations, or repository implementation in ABP.
burakdmir/abp-skills · ★ 10 · API & Backend · score 77
Install: claude install-skill burakdmir/abp-skills
# ABP Framework — Entity Framework Core A guide to EF Core integration in ABP Framework v10.4. DbContext, repository, migration, eager/lazy loading. ## Trigger - "ABP EF Core" - "ABP DbContext" - "ABP migration" - "ABP repository EF" - "ABP ConfigureByConvention" - "ABP WithDetails" - "ABP DbSet" ## DbContext ```csharp public class MyDbContext : AbpDbContext<MyDbContext> { public DbSet<Book> Books { get; set; } public MyDbContext(DbContextOptions<MyDbContext> options) : base(options) { } } ``` ## Entity Mapping ```csharp protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); builder.Entity<Book>(b => { b.ToTable("Books"); b.ConfigureByConvention(); // REQUIRED b.Property(x => x.Name).IsRequired().HasMaxLength(128); }); } ``` ## DbContext Registration ```csharp context.Services.AddAbpDbContext<MyDbContext>(options => { options.AddDefaultRepositories(); }); ``` ## DBMS Configuration ```csharp Configure<AbpDbContextOptions>(options => { options.UseSqlServer(); options.Configure<MyOtherDbContext>(opts => opts.UseMySQL()); }); ``` ## Custom Repository ```csharp public interface IBookRepository : IRepository<Book, Guid> { Task DeleteBooksByType(BookType type); } public class BookRepository : EfCoreRepository<BookStoreDbContext, Book, Guid>, IBookRepository { public BookRepository(IDbContextProv