示例#1
0
 public static ContainerBuilder RegisterProjections <TConnectedProjection, TContext>(
     this ContainerBuilder builder,
     Func <TConnectedProjection> projectionFactory,
     ConnectedProjectionSettings settings)
     where TConnectedProjection : ProjectionHandling.Connector.ConnectedProjection <TContext>
     where TContext : RunnerDbContext <TContext>
 => builder.RegisterProjections <TConnectedProjection, TContext>(container => projectionFactory(), settings);
示例#2
0
        public static ContainerBuilder RegisterProjections <TConnectedProjection, TContext>(
            this ContainerBuilder builder,
            Func <IComponentContext, TConnectedProjection> projectionFactory,
            ConnectedProjectionSettings settings)
            where TConnectedProjection : ProjectionHandling.Connector.ConnectedProjection <TContext>
            where TContext : RunnerDbContext <TContext>
        {
            builder
            .Register(container =>
                      new ConnectedProjection <TConnectedProjection, TContext>(
                          container.Resolve <Func <Owned <IConnectedProjectionContext <TContext> > > >(),
                          projectionFactory(container),
                          settings,
                          container.Resolve <ILoggerFactory>()))
            .As <IConnectedProjection>()
            .IfConcreteTypeIsNotRegistered();

            return(builder);
        }
示例#3
0
 public static ContainerBuilder RegisterProjections <TConnectedProjection, TContext>(
     this ContainerBuilder builder,
     ConnectedProjectionSettings settings)
     where TConnectedProjection : ProjectionHandling.Connector.ConnectedProjection <TContext>, new()
     where TContext : RunnerDbContext <TContext>
 => builder.RegisterProjections <TConnectedProjection, TContext>(container => new TConnectedProjection(), settings);