public Document Reconstitute() { switch (DocumentType) { case DocumentType.OtherDocument: return(OtherDocumentDto?.Reconstitute()); default: throw new ArgumentOutOfRangeException(); } }
public void Update(Document entity) { switch (entity) { case OtherDocument otherDocument: { if (OtherDocumentDto == null) { OtherDocumentDto = new OtherDocumentDto(); } OtherDocumentDto.Update(otherDocument); return; } // other inherited documents... } }