Example #1
0
        public UserRace DeleteRace(int raceId)
        {
            UserRace dbEntry = context.Races.Find(raceId);

            if (dbEntry != null)
            {
                context.Races.Remove(dbEntry);
                context.SaveChanges();
            }
            return(dbEntry);
        }
Example #2
0
        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);
        }
Example #3
0
 public void SaveRace(UserRace race)
 {
     context.Races.Add(race);
     context.SaveChanges();
 }