예제 #1
0
        public async Task CreateLocationAsync(LocationSM newLocation)
        {
            try
            {
                _uow.BeginTransaction();
                var location = _mapper.Map <Location>(newLocation);
                await _uow.GetRepository <Location>().AddItemAsync(location);

                _uow.Commit();
            }
            catch
            {
                _uow.Rollback();
            }
        }
예제 #2
0
        public async Task UpdateLocationAsync(LocationSM location)
        {
            try
            {
                _uow.BeginTransaction();

                var updateLocation = _mapper.Map <Location>(location);
                await _uow.GetRepository <Location>().UpdateAsync(updateLocation);

                _uow.Commit();
            }
            catch (Exception)
            {
                _uow.Rollback();
            }
        }