I have a table with columns username, password. Data can be updated by admin for the table.
Now I want to add a new column named IsAgree (as a flag), it need to set when user logs in for the first time. But while setting data, it should not affect other column data, I will only send usename and Isagree flag as an object.
flgDetail = { usename:"vis" Isallowed:True }
[Route("api/TermsAndCondition/setflag")]
public IHttpActionResult post(FlagDetails FlagDetail)
{
var user = _context.table.Where(s => s.UserName == flagDetail.UserName);
}
Should I use post or put?
How can I update only one column?
And it should not affect other columns.
_context.Configuration.AutoDetectChangesEnabledset to true?true. It is usually managed inside context, for example in the constructor. But you can check it where you want.bool isEanbled = _context.Configuration.AutoDetectChangesEnabled;. IfAutoDetectChangesis enabled, EF will update only changed properties