public Choice MakeChoice(bool isSelected, string optionName) { using (var db = new PickAndStick.Models.PickerContext()) { Choice choice = new Choice { IsSelected = isSelected, OptionName = optionName }; db.Add(choice); db.SaveChanges(); return(choice); } }
public WeekPick MakeWeekPick(int playerId, int seasonId) { using (var db = new PickAndStick.Models.PickerContext()) { WeekPick weekPick = new WeekPick { PlayerId = playerId, SeasonId = seasonId }; db.Add(weekPick); db.SaveChanges(); return(weekPick); } }
public Pick MakePick(List <Choice> choices, int weekPickId, int confidence) { using (var db = new PickAndStick.Models.PickerContext()) { Pick pick = new Pick { Choices = choices, WeekPickId = weekPickId, Confidence = confidence }; db.Add(pick); db.SaveChanges(); return(pick); } }
public Player makePlayer(string playerName, string playerEmail, string playerPassword) { using (var db = new PickAndStick.Models.PickerContext()) { Player player = new Player { Name = playerName, Email = playerEmail, Password = playerPassword }; db.Add(player); db.SaveChanges(); return(player); } }
public LeaguePlayer makeLeaguePlayer(int PlayerID, int LeagueID) { using (var db = new PickAndStick.Models.PickerContext()) { LeaguePlayer newLeaguePlayer = new LeaguePlayer { PlayerId = PlayerID, LeagueId = LeagueID }; db.Add(newLeaguePlayer); db.SaveChanges(); return(newLeaguePlayer); } }
public PlayerSeason makePlayerSeason(int seasonId, int playerId) { using (var db = new PickAndStick.Models.PickerContext()) { PlayerSeason playerSeason = new PlayerSeason { SeasonId = seasonId, PlayerId = playerId }; db.Add(playerSeason); db.SaveChanges(); return(playerSeason); } }
public Season makeSeason(int leagueId) { using (var db = new PickAndStick.Models.PickerContext()) { Season season = new Season { LeagueId = leagueId }; db.Add(season); db.SaveChanges(); return(season); } }
public League makeLeague(string name) { using (var db = new PickAndStick.Models.PickerContext()) { League newLeague = new League { Name = name }; db.Add(newLeague); db.SaveChanges(); return(newLeague); } }