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); } } } }
public void AddIntersection(IntersectionGameSpot intersectionGameSpot) { GameContext.Add(intersectionGameSpot); GameContext.SaveChanges(); }
public void AddIntersection(IntersectionGameSpot intersectionGameSpot) { IntersectionGameSpotRepository.AddIntersection(intersectionGameSpot); }