protected override void ConfigureApplicationContainer(TinyIoCContainer container) { base.ConfigureApplicationContainer(container); var eventsStore = new EventsStore(); var sessionsRepository = new SessionsRepository(eventsStore); var timelineMessageRepository = new TimelineMessageRepository(); var followersRepository = new FollowersRepository(); var subscriptionsRepository = new SubscriptionsRepository(eventsStore, followersRepository); var eventPublisher = new EventPublisher(); var eventPublisherWithStorage = new EventPublisherWithStorage(eventsStore, eventPublisher); eventPublisher.Subscribe(new SessionHandler(sessionsRepository)); eventPublisher.Subscribe(new UpdateTimeline(timelineMessageRepository)); eventPublisher.Subscribe(new NotifyFollowerOfFolloweeMessage(followersRepository, subscriptionsRepository, eventPublisherWithStorage)); eventPublisher.Subscribe(new UpdateFollowers(followersRepository)); container.Register <IEventPublisher>(eventPublisherWithStorage); container.Register <IUserIdentitiesRepository>(new UserIdentitiesRepository(eventsStore)); container.Register <ISessionsRepository>(sessionsRepository); container.Register <ITimelineMessageRepository>(timelineMessageRepository); container.Register <IMessagesRepository>(new MessagesRepository(eventsStore)); }
public NotifyFollowerOfFolloweeMessageTest() { _eventsStore = new EventsStore(); _followersRepository = new FollowersRepository(); var subscriptionsRepository = new SubscriptionsRepository(_eventsStore, _followersRepository); _eventPublisher = new EventPublisherFake(); _handler = new NotifyFollowerOfFolloweeMessage(_followersRepository, subscriptionsRepository, _eventPublisher); }
public SubscriptionController( IStreamStore streamStore, SubscriptionsRepository repository, ShouldReturnErrorOnReceive shouldReturnErrorOnReceive, WebHookHeaders webHookHeaders) { _streamStore = streamStore; _repository = repository; _shouldReturnErrorOnReceive = shouldReturnErrorOnReceive; _webHookHeaders = webHookHeaders; }
public ProfileController( UsersRepository usersRepository, SubscriptionsRepository subscriptionsRepository, PostsRepository postsRepository, IAzureBlobStorageService azureBlobStorageService) { this.usersRepository = usersRepository; this.subscriptionsRepository = subscriptionsRepository; this.postsRepository = postsRepository; this.azureBlobStorageService = azureBlobStorageService; }
public DimensionsService() { this.productsRepository = new ProductsRepository(); this.usersRepository = new UsersRepository(); this.profilesDimensionsRepository = new ProfilesDimensionsRepository(); this.dimensionsRepository = new DimensionsRepository(); this.profilesRepository = new ProfilesRepository(); this.usersDimensionsRepository = new UsersDimensionsRepository(); this.subscriptionsRepository = new SubscriptionsRepository(); this.utilities = new Utilities(); }
public async Task <ActionResult> Index(string channelId) { try { var accessTokenSharePoint = await AadHelper.GetAccessTokenForSharePoint(); var accessTokenMSGraph = await AadHelper.GetAccessTokenForMicrosoftGraph(); var sharePointRepository = new VideoChannelRepository(accessTokenSharePoint); var groupsRepository = new GroupsRepository(graphClient); var subscriptionsRepository = new SubscriptionsRepository(graphClient, this.Session, HttpRuntime.Cache); var channel = await sharePointRepository.GetChannel(channelId); var videos = await sharePointRepository.GetChannelVideos(channelId); var groups = await groupsRepository.GetGroups(); var viewModel = new VideoListViewModel { ChannelId = channelId, ChannelTitle = channel.Title, Videos = videos, Groups = groups }; // integration of the webhooks example Microsoft.Graph.Subscription result = await subscriptionsRepository.CreateOrReuseSubscription(); return(View(viewModel)); } catch (Exception ex) { if (ex is AdalException) { // let the ActionFilterAttribute take care of it throw ex; } return(RedirectToAction("Index", "Error", new { message = ex.Message })); } }
public AccountController(ArticlesRepository articlesRepository, SubscriptionsRepository subscriptionsRepository, UsersRepository usersRepository) : base(articlesRepository, subscriptionsRepository, usersRepository) { }
public SubscriptionsRepositoryTest() { _eventsStore = new EventsStore(); _followersRepository = new FollowersRepository(); _subscriptionsRepository = new SubscriptionsRepository(_eventsStore, _followersRepository); }
public BaseController(ArticlesRepository articlesRepository, SubscriptionsRepository subscriptionsRepository, UsersRepository usersRepository) { _articlesRepository = articlesRepository; _subscriptionsRepository = subscriptionsRepository; _usersRepository = usersRepository; }
public SubscriptionsController(SubscriptionsRepository subscriptionsRepository) { this.subscriptionsRepository = subscriptionsRepository; }
protected override void Initialize(RequestContext requestContext) { base.Initialize(requestContext); graphClient = SDKHelper.GetAuthenticatedClient(); subscriptionsRepository = new SubscriptionsRepository(graphClient, this.Session, HttpRuntime.Cache); }