public virtual void AddDocument(Document fieldDocument) { if (!fieldDocument.IsNew() && _documents.Contains(fieldDocument)) return; _documents.Add(fieldDocument); }
private Document mapToDomain(DocumentViewModel input, Document document) { var documentModel = input.Document; document.FileType = documentModel.FileType; document.Name = documentModel.Name; document.Description = documentModel.Description; if (document.DocumentCategory == null || document.DocumentCategory.EntityId != input.Document.DocumentCategory.EntityId) { document.DocumentCategory = _repository.Find<DocumentCategory>(input.Document.DocumentCategory.EntityId); } return document; }
public virtual void RemoveDocument(Document fieldDocument) { _documents.Remove(fieldDocument); }