Beispiel #1
0
        public void Add(ILocation location)
        {
            try
            {
                var headquaters = new BusinessHeadquaters
                {
                    Id   = location.Id,
                    City = location.City
                };

                Lock();

                _locationRepository.Add(location);
                _businessRepository.AddHeadquaters(headquaters, location.BusinessId);
            }
            catch (Exception)
            {
                //TODO: Rollback logic
                throw new Exception("Failed to perform atomic action - " + Desc);
            }
            finally
            {
                Unlock();
            }
        }