public MongoExpectedFilesDoc( [NotNull] MongoExtractionMessageHeaderDoc header, [NotNull] string key, [NotNull] HashSet <MongoExpectedFileInfoDoc> expectedFiles, [NotNull] MongoRejectedKeyInfoDoc rejectedKeys) { Header = header ?? throw new ArgumentNullException(nameof(header)); Key = (!string.IsNullOrWhiteSpace(key)) ? key : throw new ArgumentNullException(nameof(key)); ExpectedFiles = expectedFiles ?? throw new ArgumentNullException(nameof(expectedFiles)); RejectedKeys = rejectedKeys ?? throw new ArgumentNullException(nameof(rejectedKeys)); }
public static MongoExpectedFilesDoc FromMessage( [NotNull] ExtractFileCollectionInfoMessage message, [NotNull] IMessageHeader header, [NotNull] DateTimeProvider dateTimeProvider) { return(new MongoExpectedFilesDoc( MongoExtractionMessageHeaderDoc.FromMessageHeader(message.ExtractionJobIdentifier, header, dateTimeProvider), message.KeyValue, new HashSet <MongoExpectedFileInfoDoc>(message.ExtractFileMessagesDispatched.Select(x => new MongoExpectedFileInfoDoc(x.Key.MessageGuid, x.Value))), MongoRejectedKeyInfoDoc.FromMessage(message, header, dateTimeProvider))); }
protected bool Equals(MongoRejectedKeyInfoDoc other) { return(Equals(Header, other.Header) && RejectionInfo.OrderBy(x => x.Key).SequenceEqual(other.RejectionInfo.OrderBy(x => x.Key))); }