public Match ModifyMatch(Match newMatch) { using (var db = new DatabaseContext()) { db.Entry(newMatch).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return (Match)db.Matches.Find(newMatch.MatchId); } }
public Match CreateMatch(Match match) { using (var db = new DatabaseContext()) { Match CreatedMatch = (Match)db.Matches.Add((EntityFramework.Match)match); db.SaveChanges(); return CreatedMatch; } }