public static Validation <Error, DocumentUpdatedEvent> Create(Guid documentId, string number, string description) => DocumentNumber.Create(number) .Bind(num => DocumentDescription.Create(description) .Map(desc => new DocumentUpdatedEvent(new DocumentId(documentId), num, desc, DateTime.UtcNow)));
private static Validation <Error, Document> CreateDocument(string number = "1234", string description = "Test") { return(DocumentNumber.Create(number) .Bind(num => DocumentDescription.Create(description) .Map(desc => new Document(new DocumentId(Guid.Empty), new UserId(Guid.Empty), num, desc)))); }