public virtual async void TestDelete()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);
            var        client     = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            ApplicationDbContext context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;

            IFollowerService service = testServer.Host.Services.GetService(typeof(IFollowerService)) as IFollowerService;
            var model = new ApiFollowerServerRequestModel();

            model.SetProperties("B", DateTime.Parse("1/1/1988 12:00:00 AM"), 1, 1, "B", "B");
            CreateResponse <ApiFollowerServerResponseModel> createdResponse = await service.Create(model);

            createdResponse.Success.Should().BeTrue();

            ActionResponse deleteResult = await client.FollowerDeleteAsync(2);

            deleteResult.Success.Should().BeTrue();
            ApiFollowerServerResponseModel verifyResponse = await service.Get(2);

            verifyResponse.Should().BeNull();
        }
 public MicroblogService()
 {
     feedService     = new FeedService();
     nfService       = new NotificationService();
     friendService   = new FriendService();
     followerService = new FollowerService();
 }
 public FollowableSystem(IList <IChatClient> chatClients, IFollowerService followerService,
                         ICurrencyGenerator currencyGenerator)
 {
     _chatClients       = chatClients;
     _followerService   = followerService;
     _currencyGenerator = currencyGenerator;
 }
Beispiel #4
0
 public FeedController()
 {
     feedService    = new FeedService();
     friendService  = new FriendService();
     visitorService = new VisitorService();
     followService  = new FollowerService();
 }
Beispiel #5
0
 public StreamingPlatform(IChatClient chatClient, IFollowerService followerService,
                          IStreamingInfoService streamingInfoService)
 {
     _chatClient           = chatClient;
     _followerService      = followerService;
     _streamingInfoService = streamingInfoService;
 }
Beispiel #6
0
 public PhotoPostService()
 {
     friendService   = new FriendService();
     pickedService   = new PickedService();
     incomeService   = new UserIncomeService();
     followerService = new FollowerService();
 }
        public async Task Init()
        {
            _unitOfWork      = new UnitOfWork(_context);
            _userService     = new UserService(new UserRepository(_context, _unitOfWork));
            _followerService = new FollowerService(new Repository <Follower>(_context, _unitOfWork));

            await Seed();
        }
Beispiel #8
0
        public NotificationsHub(IFollowerService followerService, IBeerReviewService reviewService)
        {
            Guard.WhenArgument(followerService, nameof(followerService)).IsNull().Throw();
            Guard.WhenArgument(reviewService, nameof(reviewService)).IsNull().Throw();

            this.followerService = followerService;
            this.reviewService   = reviewService;
        }
 public CrowdApiController(ICrowdService crowdService, IPartImageService partImageService, IDiscountService discountService, IFollowerService followerService, IPhoneService phoneService, IParticipationService participationService)
 {
     _discountService = discountService;
     _crowdService = crowdService;
     _partImageService = partImageService;
     _followerService = followerService;
     _phoneService = phoneService;
     _participationService = participationService;
 }
Beispiel #10
0
 public ProfileController(IAccountService accountService,
                          IDiaryService diaryService,
                          IFollowerService followerService
                          )
 {
     _accountService  = accountService;
     _diaryService    = diaryService;
     _followerService = followerService;
 }
Beispiel #11
0
 public HomeController(IFollowerService followerService,
     ICrowdService crowdService,
     IWorkContext workContext
     )
 {
     _workContext = workContext;
     _followerService = followerService;
     _crowdService = crowdService;
 }
Beispiel #12
0
 public CrowdApiController(ICrowdService crowdService, IPartImageService partImageService, IDiscountService discountService, IFollowerService followerService, IPhoneService phoneService, IParticipationService participationService)
 {
     _discountService      = discountService;
     _crowdService         = crowdService;
     _partImageService     = partImageService;
     _followerService      = followerService;
     _phoneService         = phoneService;
     _participationService = participationService;
 }
Beispiel #13
0
 public HomeController(IFollowerService followerService,
                       ICrowdService crowdService,
                       IWorkContext workContext
                       )
 {
     _workContext     = workContext;
     _followerService = followerService;
     _crowdService    = crowdService;
 }
Beispiel #14
0
 public FollowerController(
     IUserService userService,
     IFollowerService followerService,
     ITempDataService tempDataService)
 {
     _userService     = userService;
     _followerService = followerService;
     _tempDataService = tempDataService;
 }
 public StreamingSystem(IChatClient chatClient, IFollowerService followerService,
                        ICurrencyGenerator currencyGenerator, ISubscriberHandler subscriberHandler,
                        IStreamingInfoService streamingInfoService)
 {
     _chatClient           = chatClient;
     _followerService      = followerService;
     _currencyGenerator    = currencyGenerator;
     _subscriberHandler    = subscriberHandler;
     _streamingInfoService = streamingInfoService;
 }
 public PostController(IHttpContextAccessor httpContextAccessor,
                       IUserService userService,
                       IPostService postService,
                       IFollowerService follwerService,
                       IPhotoService photoService)
 {
     _httpContextAccessor = httpContextAccessor;
     _postService         = postService;
     _photoService        = photoService;
 }
Beispiel #17
0
 public SongsController(IMusicRecognitionService musicRecognitionService, IOuterMusicRecognitionService outerMusicRecognitionService, IHubContext <MusicHub> musicHubContext, IMusicService musicService, UserManager <User> userManager, IHubContext <FollowingActivityHub> followingActivityHubContext, IFollowerService followerService)
 {
     this.musicRecognitionService      = musicRecognitionService;
     this.outerMusicRecognitionService = outerMusicRecognitionService;
     this.MusicHubContext             = musicHubContext;
     this.musicService                = musicService;
     this.userManager                 = userManager;
     this.FollowingActivityHubContext = followingActivityHubContext;
     this.followerService             = followerService;
 }
 public HomeController(IFollowerService followerService,
                       IDiaryService diaryService,
                       IAccountService accountService,
                       IReviewService reviewService
                       )
 {
     _followerService = followerService;
     _diaryService    = diaryService;
     _accountService  = accountService;
     _reviewService   = reviewService;
 }
Beispiel #19
0
        public void Initialize()
        {
            //Creates a fake IFollowerService with a liked observer in order to
            //assert that the SUT relies on it
            followerServiceObserver = new StubObserver();
            followerService = new Contracts.Interfaces.Fakes.StubIFollowerService
            {
                InstanceObserver = followerServiceObserver
            };

            sut = new FollowsCommand(followerService);
        }
 public AbstractFollowerController(
     ApiSettings settings,
     ILogger <AbstractFollowerController> logger,
     ITransactionCoordinator transactionCoordinator,
     IFollowerService followerService,
     IApiFollowerModelMapper followerModelMapper
     )
     : base(settings, logger, transactionCoordinator)
 {
     this.FollowerService     = followerService;
     this.FollowerModelMapper = followerModelMapper;
 }
        public ManageController(IApplicationUserManager userManager,
                                IApplicationSignInManager signInManager,
                                IFollowerService followerService)
        {
            Guard.WhenArgument(userManager, nameof(userManager)).IsNull().Throw();
            Guard.WhenArgument(signInManager, nameof(signInManager)).IsNull().Throw();
            Guard.WhenArgument(followerService, nameof(followerService)).IsNull().Throw();

            this.userManager     = userManager;
            this.signInManager   = signInManager;
            this.followerService = followerService;
        }
        public UsersController(IUnitOfWorkAsync unitOfWork, IUserService userService, IFollowerService followerService, ILikeService likeService, IHashTagInKweetService hashTagInKweetService, IMentionService mentionService, IUserRoleService userRoleService, IMapper mapper)
        {
            _unitOfWork            = unitOfWork;
            _userService           = userService;
            _followerService       = followerService;
            _likeService           = likeService;
            _hashTagInKweetService = hashTagInKweetService;
            _mentionService        = mentionService;
            _userRoleService       = userRoleService;

            _mapper = mapper;
        }
 public FollowerController(
     ApiSettings settings,
     ILogger <FollowerController> logger,
     ITransactionCoordinator transactionCoordinator,
     IFollowerService followerService,
     IApiFollowerServerModelMapper followerModelMapper
     )
     : base(settings, logger, transactionCoordinator)
 {
     this.FollowerService     = followerService;
     this.FollowerModelMapper = followerModelMapper;
     this.BulkInsertLimit     = 250;
     this.MaxLimit            = 1000;
     this.DefaultLimit        = 250;
 }
Beispiel #24
0
 public FollowerEventSubscriber(IFollowerService followerService,
                                IOutDataService mailService,
                                ITopicRepository topicRepo,
                                IPostRepository postRepo,
                                IUserProvider userProvider,
                                ITextProvider textProvider,
                                IForumConfigurationService confService,
                                ILogger logger)
 {
     this.followerService = followerService;
     this.mailService     = mailService;
     this.textProvider    = textProvider;
     this.logger          = logger;
     this.postRepo        = postRepo;
     this.userProvider    = userProvider;
     this.topicRepo       = topicRepo;
     this.confService     = confService;
 }
        public virtual async void TestUpdate()
        {
            var builder = new WebHostBuilder()
                          .UseEnvironment("Production")
                          .UseStartup <TestStartup>();
            TestServer testServer = new TestServer(builder);

            var client = new ApiClient(testServer.CreateClient());

            client.SetBearerToken(JWTTestHelper.GenerateBearerToken());
            var mapper = new ApiFollowerServerModelMapper();
            ApplicationDbContext           context = testServer.Host.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
            IFollowerService               service = testServer.Host.Services.GetService(typeof(IFollowerService)) as IFollowerService;
            ApiFollowerServerResponseModel model   = await service.Get(1);

            ApiFollowerClientRequestModel request = mapper.MapServerResponseToClientRequest(model);

            request.SetProperties("B", DateTime.Parse("1/1/1988 12:00:00 AM"), 1, 1, "B", "B");

            UpdateResponse <ApiFollowerClientResponseModel> updateResponse = await client.FollowerUpdateAsync(model.Id, request);

            context.Entry(context.Set <Follower>().ToList()[0]).Reload();
            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();
            updateResponse.Record.Id.Should().Be(1);
            context.Set <Follower>().ToList()[0].Blocked.Should().Be("B");
            context.Set <Follower>().ToList()[0].DateFollowed.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM"));
            context.Set <Follower>().ToList()[0].FollowedUserId.Should().Be(1);
            context.Set <Follower>().ToList()[0].FollowingUserId.Should().Be(1);
            context.Set <Follower>().ToList()[0].FollowRequestStatu.Should().Be("B");
            context.Set <Follower>().ToList()[0].Muted.Should().Be("B");

            updateResponse.Record.Id.Should().Be(1);
            updateResponse.Record.Blocked.Should().Be("B");
            updateResponse.Record.DateFollowed.Should().Be(DateTime.Parse("1/1/1988 12:00:00 AM"));
            updateResponse.Record.FollowedUserId.Should().Be(1);
            updateResponse.Record.FollowingUserId.Should().Be(1);
            updateResponse.Record.FollowRequestStatu.Should().Be("B");
            updateResponse.Record.Muted.Should().Be("B");
        }
 public ShareCommentsController()
 {
     shareService  = new ShareService();
     followService = new FollowerService();
 }
Beispiel #27
0
 public FollowersController(IConfiguration config, IFollowerService followerService)
 {
     _config          = config;
     _followerService = followerService;
 }
Beispiel #28
0
 public MockedManageController(IApplicationUserManager userManager,
                               IApplicationSignInManager signInManager,
                               IFollowerService followerService)
     : base(userManager, signInManager, followerService)
 {
 }
Beispiel #29
0
 public FollowersController(IFollowerService followerService)
 {
     _followerService = followerService;
 }
 public PhotoPostService() {
     friendService = new FriendService();
     pickedService = new PickedService();
     incomeService = new UserIncomeService();
     followerService = new FollowerService();
 }
Beispiel #31
0
 public BlacklistService()
 {
     userService     = new UserService();
     friendService   = new FriendService();
     followerService = new FollowerService();
 }
Beispiel #32
0
 /// <summary>
 /// </summary>
 /// <param name="followerService">Service class to use to perform the command</param>
 public FollowsCommand(IFollowerService followerService)
 {
     this.followerService = followerService;
 }
Beispiel #33
0
        public static IServiceCollection AddApplicationServices(this IServiceCollection serviceCollection)
        {
            serviceCollection.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            serviceCollection.AddSingleton <IFactory <AppDbContext>, ApplicationDbFactory>();

            serviceCollection.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
            .AddCookie(options =>
            {
                options.ExpireTimeSpan = TimeSpan.FromDays(7);
            }
                       );

            #region Cryptography
            serviceCollection.AddSingleton <IHasher, Pbkdf2Hasher>();
            serviceCollection.AddSingleton <ISaltGenerator, RandomSaltGenerator>();
            #endregion Cryptography

            #region Validators
            serviceCollection.AddTransient <IEntityValidator <Follower>, FollowerValidator>();
            serviceCollection.AddTransient <IEntityValidator <Collection>, CollectionValidator>();
            serviceCollection.AddTransient <IEntityValidator <SharedMeme>, SharedMemeValidator>();
            serviceCollection.AddTransient <IEntityValidator <Meme>, MemeValidator>();
            serviceCollection.AddTransient <IEntityValidator <MemeLike>, MemeLikeValidator>();
            serviceCollection.AddTransient <IEntityValidator <CollectionItemDetail>, CollectionItemDetailValidator>();
            serviceCollection.AddTransient <IEntityValidator <CollectionSubscriber>, CollectionSubscriberValidator>();
            serviceCollection.AddTransient <IEntityValidator <ApplicationUser>, ApplicationUserValidator>();
            serviceCollection.AddTransient <IEntityValidator <Comment>, CommentValidator>();
            serviceCollection.AddTransient <IEntityValidator <Credential>, CredentialValidator>();
            serviceCollection.AddTransient <IEntityValidator <CredentialType>, CredentialTypeValidator>();
            serviceCollection.AddTransient <IEntityValidator <Role>, RoleValidator>();
            serviceCollection.AddTransient <IEntityValidator <UserRole>, UserRoleValidator>();
            serviceCollection.AddTransient <IEntityValidator <RolePermission>, RolePermissionValidator>();
            serviceCollection.AddTransient <IEntityValidator <Permission>, PermissionValidator>();
            #endregion Validators

            #region Repositories
            serviceCollection.AddTransient <IRepository <Meme>, MemeRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <Meme> entityValidator      = serviceProvider.GetService <IEntityValidator <Meme> >();
                return(new MemeRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <Follower>, FollowerRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <Follower> entityValidator  = serviceProvider.GetService <IEntityValidator <Follower> >();
                return(new FollowerRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <Collection>, CollectionRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory  = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <Collection> entityValidator = serviceProvider.GetService <IEntityValidator <Collection> >();
                return(new CollectionRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <SharedMeme>, SharedMemeRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory  = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <SharedMeme> entityValidator = serviceProvider.GetService <IEntityValidator <SharedMeme> >();
                return(new SharedMemeRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <ApplicationUser>, UserRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory       = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <ApplicationUser> entityValidator = serviceProvider.GetService <IEntityValidator <ApplicationUser> >();
                return(new UserRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <MemeLike>, MemeLikeRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <MemeLike> entityValidator  = serviceProvider.GetService <IEntityValidator <MemeLike> >();
                return(new MemeLikeRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <CollectionItemDetail>, CollectionItemDetailRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory            = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <CollectionItemDetail> entityValidator = serviceProvider.GetService <IEntityValidator <CollectionItemDetail> >();
                return(new CollectionItemDetailRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <CollectionSubscriber>, CollectionSubscriberRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory            = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <CollectionSubscriber> entityValidator = serviceProvider.GetService <IEntityValidator <CollectionSubscriber> >();
                return(new CollectionSubscriberRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <Comment>, CommentRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <Comment> entityValidator   = serviceProvider.GetService <IEntityValidator <Comment> >();
                return(new CommentRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <Credential>, CredentialRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory  = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <Credential> entityValidator = serviceProvider.GetService <IEntityValidator <Credential> >();
                return(new CredentialRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <CredentialType>, CredentialTypeRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory      = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <CredentialType> entityValidator = serviceProvider.GetService <IEntityValidator <CredentialType> >();
                return(new CredentialTypeRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <Role>, RoleRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <Role> entityValidator      = serviceProvider.GetService <IEntityValidator <Role> >();
                return(new RoleRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <UserRole>, UserRoleRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <UserRole> entityValidator  = serviceProvider.GetService <IEntityValidator <UserRole> >();
                return(new UserRoleRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <RolePermission>, RolePermissionRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory      = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <RolePermission> entityValidator = serviceProvider.GetService <IEntityValidator <RolePermission> >();
                return(new RolePermissionRepository(applicationDbFactory.Create(), entityValidator));
            });
            serviceCollection.AddTransient <IRepository <Permission>, PermissionRepository>(serviceProvider =>
            {
                IFactory <AppDbContext> applicationDbFactory  = serviceProvider.GetService <IFactory <AppDbContext> >();
                IEntityValidator <Permission> entityValidator = serviceProvider.GetService <IEntityValidator <Permission> >();
                return(new PermissionRepository(applicationDbFactory.Create(), entityValidator));
            });
            #endregion Repositories

            #region Managers
            serviceCollection.AddScoped <IUserManager, UserManager>(serviceProvider =>
            {
                IRepository <ApplicationUser> applicationUserRepository = serviceProvider.GetService <IRepository <ApplicationUser> >();
                IRepository <Credential> credentialRepository           = serviceProvider.GetService <IRepository <Credential> >();
                IRepository <CredentialType> credentialTypeRepository   = serviceProvider.GetService <IRepository <CredentialType> >();
                IRepository <Role> roleRepository                     = serviceProvider.GetService <IRepository <Role> >();
                IRepository <UserRole> userRoleRepository             = serviceProvider.GetService <IRepository <UserRole> >();
                IRepository <RolePermission> rolePermissionRepository = serviceProvider.GetService <IRepository <RolePermission> >();
                IRepository <Permission> permissionRepository         = serviceProvider.GetService <IRepository <Permission> >();
                IHttpContextAccessor httpContextAccessor              = serviceProvider.GetService <IHttpContextAccessor>();
                IHasher hasher = serviceProvider.GetService <IHasher>();
                ISaltGenerator saltGenerator = serviceProvider.GetService <ISaltGenerator>();
                return(new UserManager(applicationUserRepository, credentialTypeRepository, credentialRepository, roleRepository, userRoleRepository, rolePermissionRepository, permissionRepository, httpContextAccessor, hasher, saltGenerator));
            });
            #endregion Managers

            #region Services
            //serviceCollection.AddTransient<IExternalMemeFetcherService, ExternalMemeFetcherService>();
            serviceCollection.AddTransient <IMemeFetcherService, LocalMemeFetcherService>();
            serviceCollection.AddTransient <IMemeService, MemeService>(serviceProvider =>
            {
                IRepository <Meme> memeRepository      = serviceProvider.GetService <IRepository <Meme> >();
                IMemeFetcherService memeFetcherService = serviceProvider.GetService <IMemeFetcherService>();
                return(new MemeService(memeFetcherService, memeRepository));
            });
            serviceCollection.AddTransient <ICollectionService, CollectionService>(serviceProvider =>
            {
                IRepository <Collection> collectionRepository = serviceProvider.GetService <IRepository <Collection> >();
                return(new CollectionService(collectionRepository));
            });
            serviceCollection.AddTransient <IUserService, UserService>(serviceProvider =>
            {
                IRepository <ApplicationUser> userRepository = serviceProvider.GetService <IRepository <ApplicationUser> >();
                IRepository <Follower> followerRepository    = serviceProvider.GetService <IRepository <Follower> >();
                IUserManager userManager = serviceProvider.GetService <IUserManager>();
                return(new UserService(userManager, userRepository, followerRepository));
            });
            serviceCollection.AddTransient <IFollowerService, FollowerService>(serviceProvider =>
            {
                IRepository <Follower> followerRepository = serviceProvider.GetService <IRepository <Follower> >();
                IRepository <ApplicationUser> applicationUserRepository = serviceProvider.GetService <IRepository <ApplicationUser> >();
                return(new FollowerService(followerRepository, applicationUserRepository));
            });
            serviceCollection.AddTransient <IMemeSharingService, MemeSharingService>(serviceProvider =>
            {
                IRepository <SharedMeme> sharedMemeRepository = serviceProvider.GetService <IRepository <SharedMeme> >();
                IRepository <ApplicationUser> userRepository  = serviceProvider.GetService <IRepository <ApplicationUser> >();
                return(new MemeSharingService(sharedMemeRepository, userRepository));
            });
            serviceCollection.AddTransient <IMemeLikingService, MemeLikingService>(serviceProvider =>
            {
                IRepository <MemeLike> memeLikeRepository = serviceProvider.GetService <IRepository <MemeLike> >();
                return(new MemeLikingService(memeLikeRepository));
            });
            serviceCollection.AddTransient <ICollectionItemDetailService, CollectionItemDetailService>(serviceProvider =>
            {
                IRepository <CollectionItemDetail> collectionItemDetailRepository = serviceProvider.GetService <IRepository <CollectionItemDetail> >();
                IRepository <Collection> collectionRepository = serviceProvider.GetService <IRepository <Collection> >();
                IRepository <Meme> memeRepository             = serviceProvider.GetService <IRepository <Meme> >();
                return(new CollectionItemDetailService(collectionItemDetailRepository, collectionRepository, memeRepository));
            });
            serviceCollection.AddTransient <ICollectionSubscriberService, CollectionSubscriberService>(serviceProvider =>
            {
                IRepository <CollectionSubscriber> collectionSubscriberRepository = serviceProvider.GetService <IRepository <CollectionSubscriber> >();
                return(new CollectionSubscriberService(collectionSubscriberRepository));
            });
            serviceCollection.AddTransient <ITempDataService, TempDataService>(serviceProvider =>
            {
                ICollectionService collectionService = serviceProvider.GetService <ICollectionService>();
                IFollowerService followerService     = serviceProvider.GetService <IFollowerService>();
                return(new TempDataService(collectionService, followerService));
            });
            serviceCollection.AddTransient <ICommentService, CommentService>(serviceProvider =>
            {
                IRepository <Comment> commentRepository = serviceProvider.GetService <IRepository <Comment> >();
                IRepository <Meme> memeRepository       = serviceProvider.GetService <IRepository <Meme> >();
                return(new CommentService(commentRepository, memeRepository));
            });
            #endregion Services

            return(serviceCollection);
        }
 public FollowableSystem(IList <IChatClient> chatClients, IFollowerService followerService)
 {
     _chatClients     = chatClients;
     _followerService = followerService;
 }
 public FollowingController(IFollowerService followerService, UserManager <User> userManager)
 {
     this._followerService = followerService;
     this.userManager      = userManager;
     this.userId           = this.userManager.GetUserId(this.User);
 }