public void Create(TicketType ticketType) { try { var mapTicketType = AutoMapper.Mapper.Map <Data.Entities.TicketType>(ticketType); _ticketTypeRepository.Add(mapTicketType); _unitOfWork.Commit(); } catch (Exception exception) { throw new FaultException(exception.Message); } }
public void Update(TicketType ticketType) { try { var mapTicketType = AutoMapper.Mapper.Map <Data.Entities.TicketType>(ticketType); var actualTicketType = _ticketTypeRepository .FindBy(t => t.Id == mapTicketType.Id) .First(); actualTicketType.Name = mapTicketType.Name; actualTicketType.Description = mapTicketType.Description; actualTicketType.IsDeleted = mapTicketType.IsDeleted; _unitOfWork.Commit(); } catch (Exception exception) { throw new FaultException(exception.Message); } }