protected override BaseEntity CreateModel(BaseEntity entity) { PlayerDb playerDb = new PlayerDb(); CardDb cardDb = new CardDb(); PlayerCardConnection con = entity as PlayerCardConnection; con.Id = (int)Reader["ID"]; con.Player = playerDb.GetPlayerById((int)Reader["player_id"]); con.Card = cardDb.SelectById((int)Reader["card_id"]); return(con); }
protected override BaseEntity CreateModel(BaseEntity entity) { PlayerDb db = new PlayerDb(); Game game = entity as Game; game.Id = (int)Reader["ID"]; game.Players.Add((Player)db.GetPlayerById((int)Reader["player_1_id"])); game.Players.Add((Player)db.GetPlayerById((int)Reader["player_2_id"])); game.Players.Add((Player)db.GetPlayerById((int)Reader["player_3_id"])); game.Players.Add((Player)db.GetPlayerById((int)Reader["player_4_id"])); game.Players.Add((Player)db.GetPlayerById((int)Reader["table_id"])); game.StartTime = (DateTime)Reader["start_date"]; game.EndTime = (DateTime)Reader["end_date"]; game.Loser = (int)Reader["losser_id"]; return(game); }
protected override BaseEntity CreateModel(BaseEntity entity) { PlayerDb playerDb = new PlayerDb(); GameDb gameDb = new GameDb(); PlayerGameConnection con = entity as PlayerGameConnection; con.Id = (int)Reader["ID"]; con.Player = playerDb.GetPlayerById((int)Reader["player_id"]); con.Game = gameDb.GetGameById((int)Reader["game_id"]); return(con); }