public async Task OnActionExecutionAsync(ActionExecutingContext contexto, ActionExecutionDelegate next) { if (!contexto.HttpContext.Request.Query .Any(w => w.Key == "gtin" && !string.IsNullOrEmpty(w.Value))) { _notificacoes.Add(Notificacao.Nova("GTIN não informado;")); } var proximo = await next(); }
public async Task OnActionExecutionAsync(ActionExecutingContext contexto, ActionExecutionDelegate next) { if (contexto.HttpContext.Request.Query .Any(w => w.Key == "geoLatitude" && ((!string.IsNullOrEmpty(w.Value) && (w.Value.FirstOrDefault().ConverterStringParaDouble() < -90 || w.Value.FirstOrDefault().ConverterStringParaDouble() > 90) ) )) ) { _notificacoes.Add(Notificacao.Nova("Latitude inválida;")); } var proximo = await next(); }