Using Both (Extend & Override)

You’re not limited to just one approach—you can combine overriding existing methods and adding new ones in a single custom repository class.

This gives you maximum flexibility:

  • Override methods to change or enhance built-in repository behavior.

  • Extend by introducing brand new methods tailored to your project’s unique requirements.

For example, you might override GetListAsync to add caching or custom filtering logic, while also introducing a brand new method like FindByDepartmentId.

This is the real power of REN.Kit’s repository design: your data layer can be as standard or as custom as you want.

circle-check

Pro Tip:


How to Use Both? (Override + Extend)

1. Create a New Interface for Your Custom Methods

public interface IExtendedRENRepository<TEntity> : IRENRepository<TEntity>
    where TEntity : class
{
    void AdditionalMethod();
}

This interface introduces your new method(s) while keeping all defaults.


2. Implement Your Custom Repository


3. Register Your Custom Implementation

Since you’re introducing a new interface and class, register both:

triangle-exclamation

Reminder:


4. Use Your Custom Repository in Action

circle-check

Pro Tip:

Last updated