public PullRequestCommentsProjector( EventStoreClient eventStore, IEventSerializer eventSerializer, IPullRequestCommentsRepository repository, ILogger <PullRequestCommentsProjector> logger ) { _eventStore = eventStore; _repository = repository; _logger = logger; _eventSerializer = eventSerializer; }
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; }