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

Refactor Generic Repository Code #250

Merged
merged 4 commits into from
Dec 11, 2021

Conversation

akema-trebla
Copy link
Contributor

More consistent generic repository approach
Made use of IIncludeableQueryable for typed Includes
Made use of IOrderedQueryable for typed OrderBy
Made provision for returning projected entities

@@ -10,9 +10,13 @@
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.0" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of Repository Pattern is to remove the Dependency with EFCore or any other ORMs in the Application / Core layer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the dependency has been removed.

@iammukeshm iammukeshm merged commit eada489 into fullstackhero:main Dec 11, 2021
@iammukeshm
Copy link
Member

Thanks! Could you please add comments over each of the interface method definitions of IRepositoryAsync ? For documentation purposes. You can do it as a new PR.

Something like

/// <summary>
    /// Get a List of Mapped Entities that match the passed Specification.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <typeparam name="TDto"></typeparam>
    /// <param name="specification"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<PaginatedResult<TDto>> GetListAsync<T, TDto>(PaginationSpecification<T> specification, CancellationToken cancellationToken = default)
    where T : BaseEntity
    where TDto : IDto;

@akema-trebla
Copy link
Contributor Author

Thanks! Could you please add comments over each of the interface method definitions of IRepositoryAsync ? For documentation purposes. You can do it as a new PR.

Something like

/// <summary>
    /// Get a List of Mapped Entities that match the passed Specification.
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <typeparam name="TDto"></typeparam>
    /// <param name="specification"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<PaginatedResult<TDto>> GetListAsync<T, TDto>(PaginationSpecification<T> specification, CancellationToken cancellationToken = default)
    where T : BaseEntity
    where TDto : IDto;

Sure

@akema-trebla akema-trebla mentioned this pull request Dec 13, 2021
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.

2 participants