public async Task MinusCountKvot(int id_kvot) { Kvot tmp_kvot = await db.SetKvots.FirstOrDefaultAsync(u => u.Id == id_kvot); tmp_kvot.CountKvot = tmp_kvot.CountKvot - 1; await db.SaveChangesAsync(); }
public void ChangeKvot(List <string> new_changes) { foreach (var item in new_changes) { System.Diagnostics.Debug.WriteLine(item); string[] tmp = item.Split('#'); int id_kvot = Int32.Parse(tmp[0]); Kvot tmp_kvot = db.SetKvots.FirstOrDefault(u => u.Id == id_kvot); tmp_kvot.CountKvot = Int32.Parse(tmp[1]); db.SaveChanges(); } }