public IActionResult Add(DocumentTypeDTOAdd documentTypeDTOAdd) { _logger.LogInformation(JsonConvert.SerializeObject(documentTypeDTOAdd)); var result = _iDocumentTypeRepository.Add(documentTypeDTOAdd); _logger.LogInformation(JsonConvert.SerializeObject(result)); return(Ok(result)); }
/// <summary> /// For the document generation to work there has to be predefined 'document types' in database. /// If there aren't any this method creates types: pdf, html, odt, json, docx /// </summary> public void AddBasicDocTypesToDb() { List <string> list = new List <string> { "pdf", "html", "json", "odt", "docx" }; foreach (string item in list) { DocumentTypeDomain docType = _documentTypeRepository.GetByName(item); if (docType == null) { _documentTypeRepository.Add(new DocumentTypeDomain() { Name = item, Code = item, Version = "1.0", Encoding = "utf-8" }); } } }
public DocumentType Add(DocumentType model) { return(_Repository.Add(model)); }
public void CreateDocumentType(DocumentType documentType) { _documentTypeRepository.Add(documentType); SaveDocumentType(); }
public void Insert(DocumentTypeViewModel model) { var contractType = AutoMapper.Mapper.Map <DocumentTypeViewModel, DocumentType>(model); _repository.Add(contractType); }