Here's the table
Users
UserId
UserName
Password
EmailAddress
and the code..
public void ChangePassword(int userId, string password){
//code to update the password..
}
Here's the table
Users
UserId
UserName
Password
EmailAddress
and the code..
public void ChangePassword(int userId, string password){
//code to update the password..
}
You can tell EF which properties have to be updated in this way:
In EntityFramework Core 2.x there is no need for
Attach
:Tried this in SQL Server and profiling it:
Find ensures that already loaded entities do not trigger a SELECT and also automatically attaches the entity if needed (from the docs):
Entity framework tracks your changes on objects that you queried from database via DbContext. For example if you DbContext instance name is dbContext
i'm using this:
entity:
dbcontext:
accessor code:
Combining several suggestions I propose the following:
called by
Or by
Or by