public async Task CreateCountryAsync(CountrySM newCountry) { try { _uow.BeginTransaction(); var country = _mapper.Map <Country>(newCountry); await _uow.GetRepository <Country>().AddItemAsync(country); _uow.Commit(); } catch { _uow.Rollback(); } }
public async Task <bool> UpdateCountryAsync(CountrySM country) { try { _uow.BeginTransaction(); var updateCountry = _mapper.Map <Country>(country); await _uow.GetRepository <Country>().UpdateAsync(updateCountry); _uow.Commit(); return(true); } catch (Exception) { _uow.Rollback(); throw; } }