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);
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); }
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);