public static Task <IDictionary <string, string> > ReadContentsByFilePath(this IFileSystemOperator @operator, IDistinctEnumerable <string> filePaths) { var filePathsByFilePath = filePaths.ToDictionarySameKeyAndValue().AsDistinctValued(); var contentsByFilePath = @operator.ReadContentsByKey(filePathsByFilePath); return(contentsByFilePath); }
public static async Task <IEnumerable <TOut> > Process <TIn, TOut>( Func <IDistinctValuedDictionary <TIn, TIn>, Task <IDictionary <TIn, TOut> > > processor, IDistinctEnumerable <TIn> inputs) { var inputsByInput = inputs.ToDictionarySameKeyAndValue().AsDistinctValued(); var resultsByInput = await processor(inputsByInput); return(resultsByInput.Values); }