Comments (3)
Browsing around source code i find your implementation like this
public async Task<int> ExecuteUpdateAsync<TEntity>(
Expression<Func<SetPropertyCalls<TEntity>, SetPropertyCalls<TEntity>>> setPropertyCalls,
CancellationToken cancellationToken = default)
where TEntity : class
{
int count = await _dbContext.Set<TEntity>().ExecuteUpdateAsync(setPropertyCalls, cancellationToken);
return count;
}
So instead of calling ExecuteUpdateAsync
directly in DbSet
, you can change function a little like so
public async Task<int> ExecuteUpdateAsync<TEntity>(
Expression<Func<SetPropertyCalls<TEntity>, SetPropertyCalls<TEntity>>> setPropertyCalls,
Expression<Func<TEntity, bool>>? predicate = null
CancellationToken cancellationToken = default)
where TEntity : class
{
var dbSet = _dbContext.Set<TEntity>();
if (predicate != null) dbSet = dbSet.Where(predicate);
return await dbSet.ExecuteUpdateAsync(setPropertyCalls, cancellationToken);
}
Anyway, your library is already good, filter in ExecuteUpdateAsync
is some niche thing
from efcore.genericrepository.
@NotAsea Thank you so much for reaching out. Surely I am taking care of it.
from efcore.genericrepository.
closing as @TanvirArjel has already had planned for it
from efcore.genericrepository.
Related Issues (20)
- A way of doing insert or update in ef core. HOT 1
- net core 5.0 many to many out of the box HOT 1
- Supporting UnitOfWork HOT 5
- How to know if delete was successful in a transaction? HOT 4
- Returning types should be changed? HOT 1
- Usage with multiple DbContexts HOT 3
- Can you do the automapper.odata support or is it redundant? HOT 1
- Incorrect instructions on using Paginated features HOT 1
- Version 6.0 : Breaking Changes HOT 5
- Support Dynamic Connection String HOT 1
- Update to EF7 HOT 1
- Paginated conditions issue HOT 2
- Generic Repository is not compatible with regular repositories HOT 1
- Problems with MySQL EF Core HOT 6
- In function GetByIdAsync, I am unable to pass Includes object HOT 1
- There are lot's of duplicated code HOT 2
- BUG: implementation ToPaginatedListAsync with PaginationSpecification only pick up the last condition in condition list HOT 2
- UpdateBy without entity available? HOT 4
- Use GenericRepository with AddDbContextFactory HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from efcore.genericrepository.