public void Delete() { WorkWithAgreeOtherPlyer work = new WorkWithAgreeOtherPlyer(); CodeFirst context = new CodeFirst(); Play play = context.Play .Where(o => o.FirstId == work.queryToUsersSecond(work.queryToUsersFirst()) && o.SecondId == work.queryToUsersFirst()) .FirstOrDefault(); context.Play.Remove(play); context.SaveChanges(); }
public void Update() { WorkWithAgreeOtherPlyer work = new WorkWithAgreeOtherPlyer(); DateTime date = new DateTime(); date = DateTime.Today; Play result = (from p in db.Play where p.FirstId == work.queryToUsersSecond(work.queryToUsersFirst()) && p.SecondId == work.queryToUsersFirst() select p).SingleOrDefault(); result.Date = date; result.Start = true; db.SaveChanges(); }