public LocationTypeDTO UpdateLocationType(LocationTypeDTO locationType) { try { var lt = _uow.LocationTypes.Update(_locationTypeFactory.Transform(locationType)); _uow.SaveChanges(); return(_locationTypeFactory.Transform(lt)); } catch (DBConcurrencyException) { return(null); } }
public LocationType Transform(LocationTypeDTO dto) { if (dto == null) { return(null); } return(new LocationType { LocationTypeId = dto.LocationTypeId, Name = dto.LocationTypeName, Description = dto.LocationTypeDescription }); }
public LocationTypeDTO AddNewLocationType(LocationTypeDTO newLocationType) { try { var lt = _locationTypeFactory.Transform(newLocationType); _uow.LocationTypes.Add(lt); _uow.SaveChanges(); return(_locationTypeFactory.Transform(lt)); } catch (DBConcurrencyException) { return(null); } }