Ejemplo n.º 1
0
 public List<Country> FindCountries(CountryCriteria criteria = null)
 {
     List<Country> countryList = null;
     string cacheKey = criteria == null ? "CountryCriteria_null" : criteria.GetCacheKey();
     if (!TryGetCacheData(cacheKey, out countryList))
     {
         countryList = GetCountryManager().FindCountries(criteria);
         SetCacheData(_cacheName, cacheKey, countryList);
     }
     return countryList;
 }
Ejemplo n.º 2
0
 public IActionResult Find(CountryCriteria criteria)
 {
     try
     {
         var result = _countriesService.FindCountries(criteria);
         return new OkObjectResult(result); // Country
     }
     catch (Exception exception)
     {
         return BadRequest(new WebApiException("Error", exception));
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Find data in database
        /// </summary>
        /// <returns></returns>
        public List<Country> Find(CountryCriteria countryCriteria = null)
        {
            List<Country> resultList = null;
            IQueryable<CountryRow> rowList = _dbContext.Country;
            CriteriaTransformer.CompleteQuery(ref rowList, countryCriteria);

            if (rowList != null && rowList.Count() > 0)
            {
                resultList = new List<Country>();
                foreach (var row in rowList)
                {
                    resultList.Add(CountryTransformer.ToBean(row));
                }
            }
            return resultList;
        }
Ejemplo n.º 4
0
 public List<Country> FindCountries(CountryCriteria countryCriteria = null)
 {
     return _module.Find(countryCriteria);
 }