public void Execute()
        {
            var unitOfWork = Environment.GetUnitOfWork();
            var addressRepository = unitOfWork.GetRepository<Address>();

            try
            {
                var address = new Address(StreetNumber, Street, PostalCode, City);
                addressRepository.Add(address);
                unitOfWork.Commit();

                Environment.Logger.Verbose("Registered address Street Number: {0} Street: {1} Postal Code: {2} City: {3}", address.StreetNumber, address.Street, address.PostalCode, address.City);
            }
            catch
            {
                unitOfWork.Rollback();
                throw;
            }
        }
Пример #2
0
 public void UpdateAddress(string streetNumber, string street, string postalCode, string city)
 {
     Address = new Address(streetNumber, street, postalCode, city);
 }