EasyRepository.EFCore
EasyRepository.EFCore copied to clipboard
File scoped and explicit enums
Summary
*** Summary is here ***
Changes made:
- Changed all files to 'file-scoped' namespaces
- Resharper automatically formatted the namespaces and using statements
- Added methods for Enum version of boolean as no tracking
- Added Obsolete messages
- Changed a typo of
async Task<int> Count(....)toasync Task<int> CountAsync(....) - Changed the Enum version of the method:
- Changed only the enum version of the method GetById to use the
AsNoTrackingoption. See below
public TEntity GetById<TEntity>(bool asNoTracking, object id)
where TEntity : class
{
return this._context.Set<TEntity>()
.FirstOrDefault(this.GenerateExpression<TEntity>(id));
}
/// <inheritdoc />
public TEntity GetById<TEntity>(EfTrackingOptions asNoTracking, object id)
where TEntity : class
{
var queryable = this.FindQueryable<TEntity>(asNoTracking)
.FirstOrDefault(this.GenerateExpression<TEntity>(id));
return queryable;
}

If you want, I can also apply the change to the classic boolean GetById<TEntity>(bool, object) method. I did not want to introduce any breaking changes, so I skipped this on the classic version.
Let the methods using normal bools stay for now. I don't think it's necessary to make a big change in one go. We will remove it in future versions. @jeffward01
First of all, big thank you for all of your change requests! I would much rather that you mention your opinion and suggest changes, rather than 'just hit accept'. Thank you.
Let the methods using normal bools stay for now. I don't think it's necessary to make a big change in one go. We will remove it in future versions. @jeffward01
Are the [Obsolete] attributes I added alright?
Remove unnecessary 'this' qualifier
Ahh, your one of these people who dislike this. ❤️ || I understand why people dislike them, I also understand why people like them. No issue at all!
I will remove all of this. keywords AND make an .editorconfig file that is .sln scoped for the library so that the coding standards could be maintained. Please give me a few days to do this
First of all, big thank you for all of your change requests! I would much rather that you mention your opinion and suggest changes, rather than 'just hit accept'. Thank you.
Let the methods using normal bools stay for now. I don't think it's necessary to make a big change in one go. We will remove it in future versions. @jeffward01
Are the
[Obsolete]attributes I added alright?Remove unnecessary 'this' qualifier
Ahh, your one of these people who dislike
this.❤️ || I understand why people dislike them, I also understand why people like them. No issue at all!I will remove all of
this.keywords AND make an.editorconfigfile that is.slnscoped for the library so that the coding standards could be maintained. Please give me a few days to do this
You are right, with .editorconfig these problems can be avoided. We are waiting for you. :D