Skip to content

Conversation

@duhowise
Copy link

  • updated generic repositories to factor in non integer id's

  • added iauditable entity as base for all auditable entities.

  • Iauditable entiity can then be used in the saved changes method to get all entries

 public interface IGenericRepositoryAsync<T,in TId> where T : class
    {
        Task<T> GetByIdAsync(TId id);
        Task<IReadOnlyList<T>> GetAllAsync();
        Task<IReadOnlyList<T>> GetPagedReponseAsync(int pageNumber, int pageSize);
        Task<T> AddAsync(T entity);
        Task UpdateAsync(T entity);
        Task DeleteAsync(T entity);
    }

    public interface IGenericRepositoryAsync<T> : IGenericRepositoryAsync<T, int> where T : class
    {

    }
  services.AddTransient(typeof(IGenericRepositoryAsync<,>), typeof(GenericRepositoryAsync<,>));

added iauditable entity as base for all auditable entities.
Iauditable entiity can then be used in the saved changes method to get all entries
@duhowise
Copy link
Author

duhowise commented Jun 2, 2021

@iammukeshm please take a look at this if you find some time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant