コード例 #1
0
 public void Delete(ShotType model)
 {
     using (var context = new BolfTrackerContext())
     {
         context.ShotTypes.Remove(model);
         context.SaveChanges();
     }
 }
コード例 #2
0
 public void Add(ShotType model)
 {
     using (var context = new BolfTrackerContext())
     {
         context.ShotTypes.Attach(model);
         context.Entry(model).State = EntityState.Added;
         context.SaveChanges();
     }
 }
コード例 #3
0
 public static PlayerRivalryStatistics CreatePlayerRivalryStatistics(Game game, Player player, Player affectedPlayer, Hole hole, ShotType shotType)
 {
     return new PlayerRivalryStatistics
     {
         Game = game,
         Player = player,
         AffectedPlayer = affectedPlayer,
         Hole = hole,
         ShotType = shotType,
         Attempts = 10,
         Points = 5
     };
 }
コード例 #4
0
        public void Update(int id, int points, ShotType shotType)
        {
            var shot = _shotRepository.GetById(id);

            shot.Points = points;
            shot.ShotType = shotType;

            _unitOfWork.Commit();
        }
コード例 #5
0
 public static Shot CreateShot(Game game, Player player, ShotType shotType, Hole hole)
 {
     return new Shot
     {
         Game = game,
         Player = player,
         ShotType = shotType,
         Hole = hole,
         ShotMade = true,
         Attempts = 1,
         Points = 10
     };
 }
コード例 #6
0
        public void Update(int id, int points, ShotType shotType)
        {
            var shot = _shotRepository.GetById(id);

            shot.Points = points;
            shot.ShotType = shotType;

            _shotRepository.Update(shot);
        }