public override void Insert(BaseEntity entity) { if (entity is User) { Inserted.Add(new ChangeEntity(CreateInsertSql, entity)); } }
private void EnumerateInsertedRecords(Dbf original, Dbf modified) { for (int i = original.Records.Count; i < modified.Records.Count; i++) { Inserted.Add(modified.Records[i]); } }
public override void Insert(BaseEntity entity) { Player p = entity as Player; if (p != null) { Inserted.Add(new ChangeEntity(CreateInsertSql, entity)); } }
public override void Insert(BaseEntity baseEntity) { if (baseEntity is Friendship) { if (((Friendship)baseEntity).User1 != null && ((Friendship)baseEntity).User2 != null) { Inserted.Add(new ChangeEntity(CreateInsertSql, baseEntity)); } } }
public void InsertList(ConnectionList entity) { ConnectionList cl = entity; foreach (var playerCardConnection in cl) { if (playerCardConnection != null) { Inserted.Add(new ChangeEntity(CreateInsertSql, playerCardConnection)); } } }
public void InsertList(PlayerList entity) { PlayerList pl = entity; foreach (var player in pl) { if (player != null) { Inserted.Add(new ChangeEntity(CreateInsertSql, player)); } } }
public void Insert(Game game) { //Inserted.Add(new ChangeEntity(CreateInsertSql, game)); foreach (Player p in game.Players) { Inserted.Add(new ChangeEntity(CreateInsertSql, new PlayerGameConnection() { Player = p, // increment the player id for each player Game = game // the game id will be the same when inserted })); } }
public void Insert(Game game) { foreach (Player p in game.Players) { foreach (Card c in p.Hand) { Inserted.Add(new ChangeEntity(CreateInsertSql, new PlayerCardConnection() { Player = p, Card = c })); } } }