Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating only the changed properties instead of the whole entity in the update function. #27

Closed
sahvey opened this issue Mar 19, 2021 · 1 comment

Comments

@sahvey
Copy link

sahvey commented Mar 19, 2021

The code below will be more useful if it is modified so that only the changed properties are updated.

public Task UpdateAsync(T entity)
        {
            _dbContext.Attach(entity);
            _dbContext.Entry(entity).State = EntityState.Modified;
            return Task.CompletedTask;
        }
@sahvey sahvey closed this as completed Mar 20, 2021
@chhinsras
Copy link
Contributor

Did it commit ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants