public MatchType ModifyMatchType(MatchType newMatchType) { using (var db = new DatabaseContext()) { db.Entry(newMatchType).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return (MatchType)db.MatchTypes.Find(newMatchType.MatchTypeId); } }
public MatchType CreateMatchType(MatchType matchType) { using (var db = new DatabaseContext()) { var CreatedMatchType = db.MatchTypes.Add((EntityFramework.MatchType)matchType); db.SaveChanges(); return (MatchType)CreatedMatchType; } }