/// <summary> /// 设置删除语句 /// </summary> private string BuildDeleteSql(out string deleteSingleSql) { var deleteSql = "DELETE FROM {0} "; if (!_primaryKey.IsNo()) { deleteSingleSql = $"{deleteSql} WHERE {AppendQuote(_primaryKey.Name)}={AppendParameter(_primaryKey.PropertyInfo.Name)};"; } else { deleteSingleSql = ""; } return(deleteSql); }
/// <summary> /// 设置删除语句 /// </summary> private string BuildDeleteSql(out string deleteSingleSql) { var deleteSql = "DELETE FROM {0} "; if (!_primaryKey.IsNo()) { deleteSingleSql = $"{deleteSql} WHERE {AppendQuote(_primaryKey.Name)}={AppendParameter(_primaryKey.PropertyInfo.Name)}"; //多租户 if (_descriptor.IsEnableTenant()) { deleteSingleSql += $" AND {AppendQuote(_descriptor.TenantIdColumnName)}={TENANT_ID_PLACEHOLDER} "; } } else { deleteSingleSql = ""; } return(deleteSql); }