protected override IQuery <WebhookDefinitionDocument> MapSpecification(ISession session, ISpecification <WebhookDefinition> specification)
 {
     return(specification switch
     {
         EntityIdSpecification <WebhookDefinition> s => Query <WebhookDefinitionIndex>(session, x => x.DefinitionId == s.Id),
         _ => AutoMapSpecification <WebhookDefinitionIndex>(session, specification)
     });
Esempio n. 2
0
 protected override IQuery <WorkflowSettingDocument> MapSpecification(ISession session, ISpecification <WorkflowSetting> specification)
 {
     return(specification switch
     {
         EntityIdSpecification <WorkflowSetting> s => Query <WorkflowSettingIndex>(session, x => x.SettingId == s.Id),
         _ => AutoMapSpecification <WorkflowSettingIndex>(session, specification)
     });
 protected override IQuery <WorkflowDefinitionDocument> MapSpecification(ISession session, ISpecification <WorkflowDefinition> specification)
 {
     return(specification switch
     {
         EntityIdSpecification <WorkflowDefinition> s => Query <WorkflowDefinitionIndex>(session, x => x.DefinitionId == s.Id),
         VersionOptionsSpecification s => Query <WorkflowDefinitionIndex>(session).WithVersion(s.VersionOptions),
         _ => AutoMapSpecification <WorkflowDefinitionIndex>(session, specification)
     });
        protected override IQuery <WorkflowDefinitionDocument> MapSpecification(ISession session, ISpecification <WorkflowDefinition> specification)
        {
            return(specification switch
            {
                EntityIdSpecification <WorkflowDefinition> s => Query <WorkflowDefinitionIndex>(session, x => x.DefinitionId == s.Id),
                LatestOrPublishedWorkflowDefinitionIdSpecification s => Query <WorkflowDefinitionIndex>(session, x => x.DefinitionId == s.WorkflowDefinitionId && (x.IsLatest || x.IsPublished)),
                WorkflowDefinitionIdSpecification s => s.VersionOptions == null
                    ? Query <WorkflowDefinitionIndex>(session, x => x.DefinitionId == s.Id)
                    : Query <WorkflowDefinitionIndex>(session, x => x.DefinitionId == s.Id).WithVersion(s.VersionOptions),

                ManyWorkflowDefinitionIdsSpecification s => s.VersionOptions == null
                    ? Query <WorkflowDefinitionIndex>(session, x => x.DefinitionId.IsIn(s.Ids))
                    : Query <WorkflowDefinitionIndex>(session, x => x.DefinitionId.IsIn(s.Ids)).WithVersion(s.VersionOptions),

                WorkflowDefinitionVersionIdSpecification s => Query <WorkflowDefinitionIndex>(session, x => x.DefinitionVersionId == s.VersionId),
                AndSpecification <WorkflowDefinition> s => MapAndSpecification(session, s),
                VersionOptionsSpecification s => Query <WorkflowDefinitionIndex>(session).WithVersion(s.VersionOptions),
                _ => AutoMapSpecification <WorkflowDefinitionIndex>(session, specification)
            });