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