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

feat(query-repository): add missing methods with 'asNoTracking' parameter to 'QueryRepository' (#55) #56

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dmitrii-kiselev
Copy link

Closes #55

@dmitrii-kiselev
Copy link
Author

Hi @TanvirArjel,

Please take a look at my pull request when you have some free time.
It will add some critical missing features.

Best Regards,
Dmitrii Kiselev

@dmitrii-kiselev
Copy link
Author

Hi @TanvirArjel,

I apologize if I distract you from your work.
Have you had a chance to see my contributions to this wonderful project?
If you have any comments, please write and I will fix everything.

I also noticed that you have a dev branch.
I assume that all new developments should be merged there first.
I apologize, I did not notice this beforehand, as it was not described on the project homepage.
If it's critical, I can recreate pull requests to merge the commit to the dev branch.

Please look at the created pull requests and give you feedback, these features are needed for this project!

I have many ideas on how to improve this project.
I would be very happy to help you support it and continue contributing to this project.

Best Regards,
Dmitrii Kiselev

@TanvirArjel
Copy link
Owner

@dmitrii-kiselev If any query contains a select expression, the entity framework core does not track by default. This is why I have avoided those overloads.

@TanvirArjel TanvirArjel reopened this Sep 28, 2024
@dmitrii-kiselev
Copy link
Author

Hi @TanvirArjel,

Thank you for your feedback.
In this case, we need to leave only one overload for PaginationSpecification<T>, which is missing from the code:

/// <summary>
/// This method returns a <see cref="PaginatedList{T}"/>.
/// </summary>
/// <typeparam name="TEntity">The type of the entity.</typeparam>
/// <param name="specification">An object of <see cref="PaginationSpecification{T}"/>.</param>
/// <param name="asNoTracking">A <see cref="bool"/> value which determines whether the return entity will be tracked by
/// EF Core context or not. Default value is false i.e tracking is enabled by default.
/// </param>
/// <param name="cancellationToken"> A <see cref="CancellationToken"/> to observe while waiting for the task to complete.</param>
/// <returns>Returns <see cref="PaginatedList{T}"/>.</returns>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="specification"/> is smaller than 1.</exception>
Task<PaginatedList<TEntity>> GetListAsync<TEntity>(
    PaginationSpecification<TEntity> specification,
    bool asNoTracking,
    CancellationToken cancellationToken = default)
    where TEntity : class;

There is only one:

public async Task<PaginatedList<T>> GetListAsync<T>(

But for Specification<T> there are both:

public Task<List<T>> GetListAsync<T>(Specification<T> specification, CancellationToken cancellationToken = default)

It is also necessary to add your thoughts about select expression on the wiki page or the project's home page.
I'll fix the code to leave one missing overload and let you know when it's done.

Best Regards,
Dmitrii Kiselev

@dmitrii-kiselev
Copy link
Author

Hi @TanvirArjel,

I fixed the code so it only contains the missing overload for PaginationSpecification<TEntity>.
Please review and provide your feedback.

Best Regards,
Dmitrii Kiselev

@dmitrii-kiselev
Copy link
Author

Hi @TanvirArjel,

Can we merge this, please?

Best Regards,
Dmitrii Kiselev

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.

Add missing methods with 'asNoTracking' parameter to 'QueryRepository'
2 participants