public static Func <IList <SignatureFileRequest>, IResultAppCollection <ISignatureFileApp> > GetSignaturesSync(IResultCollection <ISignatureFile> signatureFile, ISignatureConverter signatureConverter, string signatureFolder) => signaturesFileRequest => signaturesFileRequest. Select(signatureRequest => signatureRequest.PersonId). Map(ids => signatureFile.ResultValueOk(signatures => signatures.Where(signature => ids.Contains(signature.PersonId)))). ResultValueOk(signatureConverter.FromSignaturesFile). ToResultValueApplication(). Map(signatures => GetSignaturesFileApp(signatures, signaturesFileRequest, signatureConverter, signatureFolder));
/// <summary> /// Функция поиска по идентификатору /// </summary> public static Func <TestEnum, IResultValue <ITestDomain> > GetByIdOkFunc(IResultCollection <ITestDomain> testDomains) => id => testDomains.ResultValueOk(tests => SearchInDomains.FirstDomain(tests, id));
/// <summary> /// Функция проверки значения /// </summary> public static Func <ITestDomain, IResultError> ValidateValueOkFunc(IResultCollection <ITestDomain> testDomains) => domain => testDomains.ResultValueOk(tests => SearchInDomains.FirstDomain(tests, domain.Id).Id);
/// <summary> /// Функция записи значения /// </summary> public static Func <ITestDomain, IResultValue <TestEnum> > PostValueOkFunc(IResultCollection <ITestDomain> testDomains) => domain => testDomains.ResultValueOk(tests => SearchInDomains.FirstDomain(tests, domain.Id).Id);