public TodoDetailData TodoDetailDataUpdate([FromBody] TodoDetailData requestData) { { var data = _context.TodoDetailDataTmpPgs.Where(x => x.UserId == requestData.UserId && x.DataId == requestData.DataId); foreach (TodoDetailDataTmpPg item in data) { Clone.Convert(requestData, item); _context.Entry(item).State = EntityState.Modified; } _context.SaveChanges(); var result = Clone.Convert <TodoDetailData>(data); return(result); } }
public Person Update(Person person) { if (!Exist(person.Id)) { throw new PersonNotFoundException(); } Console.WriteLine(person); var result = _context.Persons.SingleOrDefault(p => p.Id.Equals(person.Id)); try { _context.Entry(result).CurrentValues.SetValues(person); _context.SaveChanges(); } catch (Exception e) { throw e; } return(person); }
public void Update(tbl_Product_Category mdl) { _PgContext.Entry(mdl).State = EntityState.Modified; }