urfnet / URF.Core

Unit of Work & Repositories Framework - .NET Core, NET Standard, Entity Framework Core. 100% extensible & lightweight.
https://github.com/urfnet
MIT License
309 stars 62 forks source link

CancellationToken #42

Closed Domitnator closed 5 years ago

Domitnator commented 6 years ago

Hi Guys,

The Query class (URF.Core.EF\Query.cs) has a bunch of methods. I noticed that for some of the the CancellationToken is set to default but not for all:

image

Is that done with a specific reason?

I'm using the FirstOrDefaultAsync method a lot (for including child properties) and it is quite anoying to supply the CancellationToken everytime.

var shipment = await _service
                .Query()
                .Include(s => s.RMAs)
                .FirstOrDefaultAsync(s => s.Id == id, new System.Threading.CancellationToken());

Thanks in advance,

Alfred

lelong37 commented 5 years ago

@Domitnator could you be so kind to issue a PR setting CancellationToken = default?

Domitnator commented 5 years ago

Fixed in https://github.com/urfnet/URF.Core/releases/tag/v2.2.0