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>(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); }