public async Task <DocumentTypeResponse> Get() { DocumentTypeResponse response = new DocumentTypeResponse(); List <DocumentType> documenttypes = await _context.DocumentType.ToListAsync(); if (documenttypes == null) { response.Success = false; response.Message = "No items found."; return(response); } response.Success = true; response.Message = "Items found."; response.DocumentTypes = documenttypes; return(response); }
public DocumentTypeResponse Find(Guid id) { DocumentType documentType = DocumentTypeRepository.Find(id); if (documentType == null) { return(new DocumentTypeResponse { Success = false, Message = "Modelo não encontrado" }); } DocumentTypeResponse documentTypeResponse = new DocumentTypeResponse { Message = "Modelo encontrado com sucesso", Success = true, DocumentType = documentType }; return(documentTypeResponse); }