private HelpDesk_TicketType mapViewModelToEntityTicketType(HelpDesk_TicketType_vm VMTicketType)
 {
     return(new HelpDesk_TicketType
     {
         Id = VMTicketType.Id ?? 0,
         TicketType = VMTicketType.TicketType
     });
 }
        public int EditTicketTypeById(int id, HelpDesk_TicketType_vm type)
        {
            if (id == 0)
            {
                throw new ArgumentOutOfRangeException("Id cannot be 0.");
            }

            return(_helpDeskTicketTypeRepository.EditTicketTypeById(id, mapViewModelToEntityTicketType(type)));
        }
 /// <summary>
 /// Puts the specified identifier.
 /// </summary>
 /// <param name="id">The identifier.</param>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public int Put(int id, [FromBody] HelpDesk_TicketType_vm value)
 {
     _logger.Info("Editing the ticket type wiht id" + id);
     return(_helpDeskTicketTypeManager.EditTicketTypeById(id, value));
 }
 public int CreateTicketType(HelpDesk_TicketType_vm type)
 {
     return(_helpDeskTicketTypeRepository.CreateTicketType(mapViewModelToEntityTicketType(type)));
 }
 /// <summary>
 /// Posts the specified value.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <returns></returns>
 public int Post([FromBody] HelpDesk_TicketType_vm value)
 {
     _logger.Info("Adding a new ticket type.");
     return(_helpDeskTicketTypeManager.CreateTicketType(value));
 }