Activities of "Kaspars.Avotins"

Hello,

Could you explain how SetDefaultRepository functionality is supposed to work. For me SetDefaultRepository seems to do nothing. (Tried this in different projects and also tried this on Acme.BookStore tutorial project)

How do I create/set default repository for all entities in dbContext?

Looking at documentation I create classes MyRepositoryBase<TEntity> and MyRepositoryBase<TEntity, TKey>. Then following documentation set them with SetDefaultRepository. context.Services.AddAbpDbContext<BookStoreDbContext>(options => { options.SetDefaultRepositoryClasses( typeof(MyRepositoryBase<,>), typeof(MyRepositoryBase<>) ); }); Base class MyRepositoryBase is ignored.

I get expected result when I set base class for specific entity context.Services.AddAbpDbContext<BookStoreDbContext>(options => { options.AddRepository<Authors.Author, MyRepositoryBase<Authors.Author, Guid>>(); });

Am I not misunderstanding something? I would like to set base class for all entities. How do I accomplish this?

Showing 11 to 11 of 11 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 17, 2025, 07:08
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.