public override IList <Address> GetAllAddresss()
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var store = new AddressDataStore(transaction);
         return(store.FindAll());
     }
 }
 public override IList <Address> GetAllAddresssByPostcode(string postcode)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var sDS = new AddressDataStore(transaction);
         return(sDS.FindAllByPostcode(postcode));
     }
 }
 public override Address GetAddressById(string addressId)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var sDS = new AddressDataStore(transaction);
         return(sDS.FindByKey(addressId));
     }
 }
 public override void CreateAddress(Address address)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var ptDS = new AddressDataStore(transaction);
         ptDS.Insert(address);
         transaction.Commit();
     }
 }
 public override void UpdateAddress(Address address)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var rDS = new AddressDataStore(transaction);
         rDS.Update(address);
         transaction.Commit();
     }
 }
 public override Address GetAddressByDetails(string address1, string address2, string suburb, string postcode,
                                             string state)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var sDs = new AddressDataStore(transaction);
         return(sDs.FindAllByProperties(address1, address2, suburb, postcode, state).FirstOrDefault());
     }
 }
 public override bool AddressExists(Address address)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var             aDS       = new AddressDataStore(transaction);
         IList <Address> addresses = aDS.FindAllByProperties(address.Address1, address.Address2, address.Suburb,
                                                             address.Postcode, address.State);
         if (addresses != null)
         {
             if (addresses.Count > 0)
             {
                 return(true);
             }
         }
     }
     return(false);
 }