public async Task MakeDefaultAsync(string objectName, string filterName)
{
if (!this.SkipValidation)
{
if (!this.Validated)
{
await this.ValidateAsync(AccessTypeEnum.CreateFilter, this.LoginId, this.Database, false).ConfigureAwait(false);
}
if (!this.HasAccess)
{
Log.Information("Access to create default filter '{FilterName}' for {ObjectName} was denied to the user with Login ID {LoginId}.", filterName, objectName, this.LoginId);
throw new UnauthorizedException("Access is denied.");
}
}
const string sql = "UPDATE config.filters SET is_default=true WHERE object_name=@0 AND filter_name=@1;";
await Factory.NonQueryAsync(this.Database, sql, objectName, filterName).ConfigureAwait(false);
}