What problem are you trying to solve?
FindAsync method has two overloads.
If someone makes a mistake and calls dbSet.FindAsync(id, cancellationToken) instead of dbSet.FindAsync([id], cancellationToken)
wrong overload version will be selected. Compiler won't complain.
Describe the solution you'd like
I believe, it's worth either having an additional prioritized overload:
Task<TEntity?> FindAsync(object id, CancellationToken cancellationToken);
Or just move cancellationToken out of the last component of the array.
Alternatively, it can be an analyzer.
What problem are you trying to solve?
FindAsyncmethod has two overloads.If someone makes a mistake and calls
dbSet.FindAsync(id, cancellationToken)instead ofdbSet.FindAsync([id], cancellationToken)wrong overload version will be selected. Compiler won't complain.
Describe the solution you'd like
I believe, it's worth either having an additional prioritized overload:
Or just move
cancellationTokenout of the last component of the array.Alternatively, it can be an analyzer.