Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated generic repositories to factor in non integer id's #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

None yet

1 participant