public async Task DeleteAsync(string filterName)
{
if (string.IsNullOrWhiteSpace(this.Database))
{
return;
}
if (!this.SkipValidation)
{
if (!this.Validated)
{
await this.ValidateAsync(AccessTypeEnum.Delete, this.LoginId, this.Database, false).ConfigureAwait(false);
}
if (!this.HasAccess)
{
Log.Information("Access to delete entity \"Filter\" with Filter Name {FilterName} was denied to the user with Login ID {LoginId}.", filterName, this.LoginId);
throw new UnauthorizedException("Access is denied.");
}
}
const string sql = "DELETE FROM config.filters WHERE filter_name=@0;";
await Factory.NonQueryAsync(this.Database, sql, filterName).ConfigureAwait(false);
}