Beispiel #1
0
        public async Task <int> Delete <T>(string propertyName, long propertyValue) where T : class
        {
            IEntityType entityType = DbContextExtension.GetEntityType <T>(dbContext);

            if (entityType != null)
            {
                string tableName = entityType.GetTableName();
                return(await this.ExecuteBySql(DbContextExtension.DeleteSql(tableName, propertyName, propertyValue)));
            }
            return(-1);
        }
        public async Task <int> Delete <T>() where T : class
        {
            IEntityType entityType = DbContextExtension.GetEntityType <T>(dbcontext);

            if (entityType != null)
            {
                string tableName = entityType.Relational().TableName;
                return(await this.ExecuteBySql(DbContextExtension.DeleteSql(tableName)));
            }
            return(-1);
        }
Beispiel #3
0
        public async Task <int> Delete <T>(long[] keyValue) where T : class
        {
            IEntityType entityType = DbContextExtension.GetEntityType <T>(dbContext);

            if (entityType != null)
            {
                string tableName = entityType.GetTableName();
                string keyField  = "Id";
                return(await this.ExecuteBySql(DbContextExtension.DeleteSql(tableName, keyField, keyValue)));
            }
            return(-1);
        }