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(); } }
public Spot Add(Spot model) { _repository.Add(model); return(model); }