Пример #1
0
        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);
        }
Пример #2
0
        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);
        }