Esempio n. 1
0
        public bool IsCountryEmbargoed(SearchCountryBlacklistRequest model)
        {
            Establish.For(model, nameof(model)).IsNotNull()
            .Property(x => x.CountryCode, nameof(model.CountryCode), e => e.IsNotNullOrEmpty().HasExactLength(2));

            return(CSDenialService.IsCountryEmbargoed(model.CountryCode));
        }
Esempio n. 2
0
        public IActionResult SearchCountry([HttpTrigger(AuthorizationLevel.Function, "post", Route = "search/country")] SearchCountryBlacklistRequest model, ILogger logger)
        {
            try
            {
                var isCountryEmbargoed = BlacklistManager.IsCountryEmbargoed(model);
                var result             = new { IsEmbargoed = isCountryEmbargoed };

                return(new OkObjectResult(result));
            }
            catch (Exception ex)
            {
                return(new BadRequestObjectResult(new ExceptionResult(ex)));
            }
        }