Esempio n. 1
0
 public PullRequestCommentsProjector(
     EventStoreClient eventStore,
     IEventSerializer eventSerializer,
     IPullRequestCommentsRepository repository,
     ILogger <PullRequestCommentsProjector> logger
     )
 {
     _eventStore      = eventStore;
     _repository      = repository;
     _logger          = logger;
     _eventSerializer = eventSerializer;
 }
Esempio n. 2
0
        public static IServiceCollection AddPullRequestCommentsSlice(
            this IServiceCollection services,
            EventStoreClient eventStore,
            IPullRequestCommentsRepository?repository = null
            )
        {
            IEventSerializer eventSerializer = new PullRequestCommentsEventSerializer();
            IPullRequestCommentsRepository pullRequestComments =
                repository ?? new InMemoryPullRequestCommentsRepository();

            return(services
                   .AddSingleton <IPullRequestCommentsRepository>(pullRequestComments)
                   .AddHostedService <PullRequestCommentsProjector>(serviceProvider => new PullRequestCommentsProjector(
                                                                        eventStore,
                                                                        eventSerializer,
                                                                        pullRequestComments,
                                                                        serviceProvider.GetService <ILogger <PullRequestCommentsProjector> >() !
                                                                        )));
        }
 public PullRequestCommentsController(IPullRequestCommentsRepository repository)
 {
     _repository = repository;
 }