Exemplo n.º 1
0
        private void LinkGameToSpots(ICollection <string> formKeys, GameModel game)
        {
            List <Spot> allSpots = SpotService.GetAllSpots();

            foreach (string key in formKeys)
            {
                foreach (Spot spot in allSpots)
                {
                    if (spot.Id.ToString() == key)
                    {
                        IntersectionGameSpot intersectionGameSpot = new IntersectionGameSpot
                        {
                            GameId = game.Id,
                            SpotId = spot.Id
                        };
                        IntersectionGameSpotService.AddIntersection(intersectionGameSpot);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void AddIntersection(IntersectionGameSpot intersectionGameSpot)
 {
     GameContext.Add(intersectionGameSpot);
     GameContext.SaveChanges();
 }
 public void AddIntersection(IntersectionGameSpot intersectionGameSpot)
 {
     IntersectionGameSpotRepository.AddIntersection(intersectionGameSpot);
 }