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
AsNoTracking
option. 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.