コード例 #1
0
        public void Add(ISpot spot)
        {
            try
            {
                Lock();

                _spotRepository.Add(spot);
                _locationRepository.AddSpot(spot.Id, spot.LocationId);
            }
            catch (Exception)
            {
                //TODO: Rollback logic
                throw new Exception("Failed to perform atomic action - " + Desc);
            }
            finally
            {
                Unlock();
            }
        }
コード例 #2
0
        public Spot Add(Spot model)
        {
            _repository.Add(model);

            return(model);
        }