public IGameDetails Insert(IGameDetails entity) { if (entity is null) { return(null); } _appDatabaseProvider.TransactionalSqlCommand((db, transaction) => { db.Execute(SqliteScripts.Table.Game.Insert, entity, transaction); foreach (var category in entity.Categories) { db.Execute(SqliteScripts.Table.GameCategory.Insert, new { category.Id, category.Name, category.ParentCategoryId, GameId = entity.Id }, transaction); } }); return(entity); }
public IUserProfile Delete(IUserProfile entity) { if (entity is null) { return(null); } _appDatabaseProvider.TransactionalSqlCommand((db, transaction) => { db.Execute(SqliteScripts.Table.Profile.Delete, new { entity.Id }, transaction); }); return(entity); }