public async override Task TestDeleteAsync() { using (var transaction = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { int countryId = 3; Assert.IsTrue(await countryDao.DeleteAsync(countryId)); Country test = await countryDao.FindByIdAsync(countryId); Assert.IsNull(test); } }
public async Task <Country> GetCountryForAddressId(int addressId) { try { Address a = await addressDao.FindByIdAsync(addressId); Community c = await communityDao.FindByIdAsync(a.CommunityId); District d = await districtDao.FindByIdAsync(c.DistrictId); Province p = await provinceDao.FindByIdAsync(d.ProvinceId); return(await countryDao.FindByIdAsync(p.CountryId)); } catch (Common.Dal.Ado.MySqlException ex) { throw new BusinessSqlException(ex.Message, ex.InnerException); } }
private async Task <bool> SkierValidator(Skier skier) => await _countryDao.FindByIdAsync(skier.CountryId) != null && await _genderDao.FindByIdAsync(skier.GenderId) != null && !string.IsNullOrWhiteSpace(skier.FirstName) && !string.IsNullOrWhiteSpace(skier.LastName);