public HelpDesk_TicketDocuments GetSingleDocument(int documentId)
        {
            HelpDesk_TicketDocuments singleDoc =
                _context.HelpDesk_TicketDocuments.FirstOrDefault(x => x.Id == documentId);

            return(singleDoc);
        }
 private HelpDesk_TicketDocuments_vm mapEntityToViewModelTicketDocuments(HelpDesk_TicketDocuments EFTicketDocument)
 {
     return(new HelpDesk_TicketDocuments_vm
     {
         DocumentPath = EFTicketDocument.DocumentPath,
         Id = EFTicketDocument.Id,
         TicketID = EFTicketDocument.TicketID
     });
 }
 public bool DeleteDocument(int documentID)
 {
     try
     {
         HelpDesk_TicketDocuments doc = _context.HelpDesk_TicketDocuments.FirstOrDefault(x => x.Id == documentID);
         _context.HelpDesk_TicketDocuments.Remove(doc);
         _context.SaveChanges();
         _logger.Debug("Ticket documetn with id " + documentID + " was deleted.");
         return(true);
     }
     catch (Exception ex)
     {
         _logger.Error(ex);
         return(false);
     }
 }
 public int SaveDocument(HelpDesk_TicketDocuments document)
 {
     _context.HelpDesk_TicketDocuments.Add(document);
     _context.SaveChanges();
     return(document.Id);
 }