示例#1
0
        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);
        }
示例#2
0
        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);
        }