public Country GetCountry(CountryKey key) { Country country = null; string cacheKey = key == null ? "CountryKey_null" : key.GetCacheKey(); if (key != null && !TryGetCacheData(cacheKey, out country)) { country = GetCountryManager().GetCountry(key); SetCacheData(_cacheName, cacheKey, country); } return country; }
/// <summary> /// Get data in database /// </summary> /// <param name="key">Primary Key</param> /// <returns>read data</returns> public Country Get(CountryKey key) { if (key == null || key.Id == 0) return null; var row = _dbContext.Country.Where(m => m.Id == key.Id).FirstOrDefault(); if (row != null) { return CountryTransformer.ToBean(row); } return null; }
internal Country GetCountry(CountryKey key) { return _module.Get(key); }