public UserRace DeleteRace(int raceId) { UserRace dbEntry = context.Races.Find(raceId); if (dbEntry != null) { context.Races.Remove(dbEntry); context.SaveChanges(); } return(dbEntry); }
public void SaveRace(int mistakes, int speed, int trackId) { UserRace race = new UserRace(); race.TrackID = trackId; race.Mistakes = mistakes; race.Speed = speed; race.RaceDate = DateTime.Now; race.UserName = HttpContext.User.Identity.Name; Races.SaveRace(race); }
public void SaveRace(UserRace race) { context.Races.Add(race); context.SaveChanges(); }