Esempio n. 1
0
 public RatingController(IRatingRepository repository, ILogger <RatingController> logger, IPublishEndpoint publishEndpoint, IMapper mapper)
 {
     _repository      = repository ?? throw new ArgumentNullException(nameof(repository));
     _logger          = logger ?? throw new ArgumentNullException(nameof(logger));
     _publishEndpoint = publishEndpoint ?? throw new ArgumentNullException(nameof(publishEndpoint));
     _mapper          = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
Esempio n. 2
0
 public MoviesDomain(IMoviesRepository moviesRepository, IRatingRepository ratingRepository)
 {
     _moviesRepository = moviesRepository;
     //I had some circular references with movies and rating domains.
     //Ideally a domain should only talk directly with its own repository, shouldn't be talking to other repositories
     _ratingRepository = ratingRepository;
 }
 public RatingsController(IRatingRepository ratingRespository,
                          ILogger <RatingsController> logger
                          )
 {
     _ratingRespository = ratingRespository;
     _logger            = logger;
 }
Esempio n. 4
0
 public UnitOfWork(AppDbContext context)
 {
     this.context = context;
     contents     = new ContentRepository(context);
     ratings      = new RatingRepository(context);
     users        = new UserRepository(context);
 }
Esempio n. 5
0
 public BanService(UserManager <ApplicationUser> userManager, IPostRepository postrepo, IMovieRepository movierepo, IRatingRepository ratingrepo)
 {
     _userManager = userManager;
     _postrepo    = postrepo;
     _movierepo   = movierepo;
     _ratingrepo  = ratingrepo;
 }
Esempio n. 6
0
 public UserController(IUserRepository _userRepository,
                       IRatingRepository _ratingRepository,
                       IValidator _validator,
                       IPasswordHasher _passwordHasher,
                       ICounterRepository _counterRepository,
                       IPersistentLoginHandler _loginHandler,
                       ITimedTrainingScoreRepository _timedTrainingScoreRepository,
                       IUserVerifier _userVerifier,
                       IEmailSender _emailSender,
                       IGameRepository _gameRepository,
                       IOptions <Settings> settings)
     : base(_userRepository, _loginHandler)
 {
     userRepository               = _userRepository;
     ratingRepository             = _ratingRepository;
     validator                    = _validator;
     passwordHasher               = _passwordHasher;
     counterRepository            = _counterRepository;
     loginHandler                 = _loginHandler;
     timedTrainingScoreRepository = _timedTrainingScoreRepository;
     userVerifier                 = _userVerifier;
     emailSender                  = _emailSender;
     gameRepository               = _gameRepository;
     recaptchaKey                 = settings.Value.RecaptchaKey;
     requireEmailVerification     = settings.Value.Email.RequireEmailVerification;
 }
 //TODO: HTTP module as a base for logging and exception handling
 // Add stopwatch
 // Remove multiple SQL calls
 // Move to React
 //autologin
 //remove async task
 //talk about httpmodule, that it must do all that doing apicontroller now
 //remove from constructor repository and logger
 //private field _repository move to api controller, or create other to do this
 public RatingController(
     IRatingRepository repository,
     ILogger <ApiController> logger)
     : base(logger)
 {
     _repository = repository;
 }
Esempio n. 8
0
        public MovieDetailViewModel(IPeopleRepository personRepository,
                                    IMoviePersonActorRepository movieActorRepository,
                                    IMoviePersonDirectorRepository movieDirectorRepository,
                                    IRatingRepository ratingRepository,
                                    IMessageDialogService messageDialogService
                                    )
        {
            _personRepository        = personRepository;
            _movieActorRepository    = movieActorRepository;
            _movieDirectorRepository = movieDirectorRepository;
            _ratingRepository        = ratingRepository;
            _messageDialogService    = messageDialogService;

            PersonShowDetailCommand     = new RelayCommand <PersonListModel>(ShowPersonDetail, (canExecute) => true);
            MovieEditDetailCommand      = new RelayCommand(EditMovieDetail, (canExecute) => true);
            MovieSaveCommand            = new RelayCommand(SaveNewMovie, (canExecute) => true);
            MovieDeleteDetailCommand    = new RelayCommand(DeleteMovieDetail, (canExecute) => CanDeleteFlag);
            MovieCloseDetailViewCommand = new RelayCommand(CloseMovieDetailView, (canExecute) => true);
            RatingShowFormCommand       = new RelayCommand(ShowAddRatingForm, canExecute => true);
            RatingSaveNewCommand        = new RelayCommand(SaveNewRating, canExecute => true);
            RatingDiscardNewCommand     = new RelayCommand(DiscardNewRating, canExecute => true);

            Messenger.Default.Register <MovieNewWrapper>(this, OnMovieAddNewReceived);
            Messenger.Default.Register <MovieSelectedWrapper>(this, OnMovieSelectedReceived);
        }
Esempio n. 9
0
 public ProductService(IProductRepository productRepository, IRatingRepository ratingRepository, IUserRepository userRepository, IMapper mapper)
 {
     _productRepository = productRepository;
     _ratingRepository  = ratingRepository;
     _userRepository    = userRepository;
     _mapper            = mapper;
 }
Esempio n. 10
0
 public AuthorController(IAuthorRepository authorRepository, IRatingRepository ratingRepository,
                         ILogger <AuthorController> logger)
 {
     _authorRepository = authorRepository;
     _ratingRepository = ratingRepository;
     _logger           = logger;
 }
Esempio n. 11
0
 public RatingService(IRatingRepository ratingRepository, ICategoryRatingRepository categoryRatingRepository, ICategoryRepository categoryRepository, ILogger <RatingService> logger)
 {
     _logger                   = logger;
     _ratingRepository         = ratingRepository;
     _categoryRatingRepository = categoryRatingRepository;
     _categoryRepository       = categoryRepository;
 }
Esempio n. 12
0
 /// <summary>
 /// 测试用构造器
 /// </summary>
 /// <param name="tenantTypeId">租户类型Id</param>
 /// <param name="ratingGradeRepository">评价选项数据访问</param>
 /// <param name="ratingRecordRepository">评价操作记录数据访问</param>
 /// <param name="ratingRepository">评价信息数据访问</param>
 public RatingService(string tenantTypeId, IRatingGradeRepository ratingGradeRepository, IRatingRecordRepository ratingRecordRepository, IRatingRepository ratingRepository)
 {
     this.tenantTypeId           = tenantTypeId;
     this.ratingRecordRepository = ratingRecordRepository;
     this.ratingRepository       = ratingRepository;
     this.ratingGradeRepository  = ratingGradeRepository;
 }
Esempio n. 13
0
 public GameService(IGameRepository gameRepository, IRatingRepository ratingRepository, IMediatorHandler bus, IMapper mapper)
 {
     _gameRepository   = gameRepository;
     _ratingRepository = ratingRepository;
     _bus    = bus;
     _mapper = mapper;
 }
Esempio n. 14
0
 public MoviesController(IMovieRepository movieRepository, IUserRepository userRepository, IRatingRepository ratingRepository)   //ApiContext context,
 {
     //_context = context;
     _movieRepository  = movieRepository;
     _userRepository   = userRepository;
     _ratingRepository = ratingRepository;
 }
Esempio n. 15
0
 public RatingsController(IMovieRatingRepository ratingsRepo, IUserRepository users, IRatingRepository ratings, IMapper mapper)
 {
     this.ratingValues = ratings;
     this.mapper       = mapper;
     this.users        = users;
     this.movieRatings = ratingsRepo;
 }
Esempio n. 16
0
 private DBContext()
 {
     _accounts           = new AccountRepository();
     _accountTypes       = new AccountTypeRepository();
     _audits             = new AuditRepository();
     _categories         = new CategoryRepository();
     _containers         = new ContainerRepository();
     _dimensions         = new DimensionRepository();
     _facilities         = new FacilityRepository();
     _facilityTypes      = new FacilityTypeRepository();
     _priorities         = new PriorityRepository();
     _users              = new UserRepository();
     _packagingLevels    = new PackagingLevelRepository();
     _pictures           = new PictureRepository();
     _projects           = new ProjectRepository();
     _ratings            = new RatingRepository();
     _requests           = new RequestRepository();
     _requestItems       = new RequestItemRepository();
     _requestItemTypes   = new RequestItemTypeRepository();
     _roles              = new RoleRepository();
     _sources            = new SourceRepository();
     _status             = new StatusRepository();
     _status             = new StatusRepository();
     _tasks              = new TaskRespository();
     _dcIssueItems       = new DCIssueItemRepository();
     _dcIssues           = new DCIssueRepository();
     _dcIssuesFacilities = new DCIssueFacilityRepository();
     _failedSamples      = new FailedSampleRepository();
     _requestCategories  = new RequestCategoryRepository();
 }
Esempio n. 17
0
 public FeelSearchQueryHandler(IEventRepository eventRepository,
                               IEventCategoryRepository eventCategoryRepository,
                               IEventDetailRepository eventDetailRepository,
                               IVenueRepository venueRepository,
                               ICountryRepository countryRepository,
                               ICityRepository cityRepository,
                               IStateRepository stateRepository,
                               IEventTicketDetailRepository eventTicketDetailRepository,
                               IEventTicketAttributeRepository eventTicketAttributeRepository,
                               ICurrencyTypeRepository currencyTypeRepository,
                               IRatingRepository ratingRepository,
                               IEventSiteIdMappingRepository eventSiteIdMappingRepository,
                               IEventCategoryMappingRepository eventCategoryMappingRepository)
 {
     _eventRepository                = eventRepository;
     _eventCategoryRepository        = eventCategoryRepository;
     _eventDetailRepository          = eventDetailRepository;
     _venueRepository                = venueRepository;
     _cityRepository                 = cityRepository;
     _countryRepository              = countryRepository;
     _stateRepository                = stateRepository;
     _eventTicketDetailRepository    = eventTicketDetailRepository;
     _eventTicketAttributeRepository = eventTicketAttributeRepository;
     _currencyTypeRepository         = currencyTypeRepository;
     _eventSiteIdMappingRepository   = eventSiteIdMappingRepository;
     _eventCategoryMappingRepository = eventCategoryMappingRepository;
     _ratingRepository               = ratingRepository;
 }
Esempio n. 18
0
 public CmsKitDataSeedContributor(
     IGuidGenerator guidGenerator,
     ICmsUserRepository cmsUserRepository,
     CmsKitTestData cmsKitTestData,
     ICommentRepository commentRepository,
     ReactionManager reactionManager,
     IRatingRepository ratingRepository,
     ICurrentTenant currentTenant,
     IContentRepository contentRepository,
     ITagManager tagManager,
     IEntityTagManager entityTagManager,
     IPageRepository pageRepository,
     IOptions <CmsKitOptions> options,
     IOptions <CmsKitTagOptions> tagOptions)
 {
     _guidGenerator     = guidGenerator;
     _cmsUserRepository = cmsUserRepository;
     _cmsKitTestData    = cmsKitTestData;
     _commentRepository = commentRepository;
     _reactionManager   = reactionManager;
     _ratingRepository  = ratingRepository;
     _currentTenant     = currentTenant;
     _contentRepository = contentRepository;
     _tagManager        = tagManager;
     _entityTagManager  = entityTagManager;
     _pageRepository    = pageRepository;
     _options           = options;
     _tagOptions        = tagOptions;
 }
Esempio n. 19
0
 public RatingsQuery(IRatingRepository repository)
 {
     Field <ListGraphType <RatingType> >(
         "ratings",
         resolve: context => repository.GetAll()
         );
 }
Esempio n. 20
0
 public UnitOfWork(BlogContext context,
                   IPostRepository posts,
                   IPostContentRepository postContents,
                   ICommentRepository comments,
                   ITagRepository tags,
                   IRatingRepository ratings,
                   IVerificationRepository authorVerifications,
                   IVerificationStatusRepository verificationStatuses,
                   IProfileRepository userProfiles,
                   UserManager <User> userManager,
                   RoleManager <IdentityRole> roleManager,
                   SignInManager <User> signInManager)
 {
     _context             = context;
     Posts                = posts;
     PostContents         = postContents;
     Comments             = comments;
     Tags                 = tags;
     Ratings              = ratings;
     AuthorVerifications  = authorVerifications;
     VerificationStatuses = verificationStatuses;
     UserProfiles         = userProfiles;
     UserManager          = userManager;
     RoleManager          = roleManager;
     SignInManager        = signInManager;
 }
Esempio n. 21
0
 public RatingManager(
     IRatingRepository ratingRepository,
     IRatingEntityTypeDefinitionStore ratingDefinitionStore)
 {
     RatingRepository      = ratingRepository;
     RatingDefinitionStore = ratingDefinitionStore;
 }
Esempio n. 22
0
 public UnitOfWork(PayrollContext payrollContext, IDepartmentRepository departmentRepository, IGradeRepository gradeRepository, IRatingRepository ratingRepository)
 {
     _payrollContext       = payrollContext;
     _departmentRepository = departmentRepository;
     _gradeRepository      = gradeRepository;
     _ratingRepository     = ratingRepository;
 }
Esempio n. 23
0
 /// <summary>
 /// 测试用构造器
 /// </summary>
 /// <param name="tenantTypeId">租户类型Id</param>
 /// <param name="ratingGradeRepository">评价选项数据访问</param>
 /// <param name="ratingRecordRepository">评价操作记录数据访问</param>
 /// <param name="ratingRepository">评价信息数据访问</param>
 public RatingService(string tenantTypeId, IRatingGradeRepository ratingGradeRepository, IRatingRecordRepository ratingRecordRepository, IRatingRepository ratingRepository)
 {
     this.tenantTypeId = tenantTypeId;
     this.ratingRecordRepository = ratingRecordRepository;
     this.ratingRepository = ratingRepository;
     this.ratingGradeRepository = ratingGradeRepository;
 }
Esempio n. 24
0
 public SearchController(IBookRepository bookRepository, IRatingRepository ratingRepository,
                         ILogger <UserController> logger)
 {
     _bookRepository   = bookRepository;
     _ratingRepository = ratingRepository;
     _logger           = logger;
 }
Esempio n. 25
0
 public RatingUpdater(IUserRepository _userRepository, IPuzzleRepository _puzzleRepository, IRatingRepository _ratingRepository, IAttemptRepository _attemptRepository)
 {
     userRepository    = _userRepository;
     puzzleRepository  = _puzzleRepository;
     ratingRepository  = _ratingRepository;
     attemptRepository = _attemptRepository;
 }
Esempio n. 26
0
 public RatingController(IRatingRepository ratingRepository, UserManager <IdentityUser> userManager,
                         ILogger <RatingController> logger)
 {
     _ratingRepository = ratingRepository;
     _userManager      = userManager;
     _logger           = logger;
 }
Esempio n. 27
0
 public CommentService(IProductRepository productRepository, IRatingRepository ratingRepository, IUserRepository userRepository, ICommentRepository commentRepository, IMapper mapper)
 {
     _productRepository = productRepository;
     _userRepoistory    = userRepository;
     _ratingRepository  = ratingRepository;
     _commentRepository = commentRepository;
     _mapper            = mapper;
 }
 public RatingService(
     IRatingRepository ratingRepository,
     IMapper mapper
     )
 {
     _ratingRepository = ratingRepository;
     _mapper           = mapper;
 }
Esempio n. 29
0
 public RatingsController(IRatingRepository ratingRepository, IUserRepository userRepository, IUserHelper userHelper,
                          RatingValidator validator)
 {
     _ratingRepository = ratingRepository;
     _userRepository   = userRepository;
     _userHelper       = userHelper;
     _validator        = validator;
 }
Esempio n. 30
0
 public FilmService(IFilmRepository repository,
                    IRatingRepository ratingRepository, IMapper mapper)
 {
     _filmRepository   = repository;
     _ratingRepository = ratingRepository;
     _mapper           = mapper;
     pageSize          = 6;
 }
Esempio n. 31
0
 public GameManager(IGameRepository gameRepository, IGameValidator gameValidator, IGameCriteria gameCriteria, IGameEngine gameEngine, IRatingRepository ratingRepository)
 {
     _GameRepository = gameRepository;// Ioc.Container.Get<IGameRepository>();
     _GameValidator = gameValidator;
     _GameCriteria = gameCriteria;
     _GameEngine = gameEngine;
     _RatingRepository = ratingRepository;
 }
Esempio n. 32
0
 public MovieService(IMovieRepository movieRepository, IActorRepository actorRepository, IMapper mapper, IActingRepository actingRepository, IRatingRepository ratingRepository)
 {
     _movieRepository  = movieRepository;
     _actorRepository  = actorRepository;
     _mapper           = mapper;
     _actingRepository = actingRepository;
     _ratingRepository = ratingRepository;
 }
Esempio n. 33
0
 public DocumentController(IRepository documentRepository, ISuggestionDictionary suggestionRepository, IImageRepository imageRepository, IRatingRepository ratingRepository, IReviewRepository reviewRepository)
 {
     _documentRepository = documentRepository;
     _suggestionRepository = suggestionRepository;
     _imageRepository = imageRepository;
     _ratingRepository = ratingRepository;
     _reviewRepository = reviewRepository;
 }
Esempio n. 34
0
        public DocumentModule(IRepository documents, IImageRepository images, IRatingRepository ratings, IReviewRepository reviews, IFavoritesRepository favorites, IEnvironmentPathProvider pathProvider)
            : base("/documents")
        {
            Get["/{id}/thumbnail"] = args =>
            {
                var doc = documents.GetDocument(args.id, true);
                string img = images.GetDocumentImage(args.id);

                if (String.IsNullOrEmpty(img))
                {
                    return ResolvePlaceHolderImageForDocumentType(pathProvider, doc);
                }

                return Response.AsFile(Path.Combine(pathProvider.GetImageCachePath(), img));
            };

            Get["/{id}"] = args =>
            {
                Document document = documents.GetDocument(args.id, false);
                return Response.AsJson(DtoMaps.Map(document, favorites, Context.GetUserInfo()));
            };
            
            Get["/{id}/rating"] = args =>
            {
                try
                {
                    DocumentRating rating = ratings.GetDocumentRating(args.id);

                    return Response.AsJson(new DocumentRatingDto
                    {
                        MaxScore = rating.MaxScore,
                        Score = rating.Score,
                        Source = rating.Source,
                        SourceUrl = rating.SourceUrl,
                        HasRating = true
                    }).AsCacheable(DateTime.Now.AddDays(1));
                }
                catch
                {
                    return new DocumentRatingDto {Success = true, HasRating = false};
                }
            };

            Get["/{id}/review"] = args =>
            {
                string review = reviews.GetDocumentReview(args.id);
                return Response.AsJson(new DocumentReviewDto{ Review = review, Url = "" }).AsCacheable(DateTime.Now.AddDays(1));
            };

            Get["/search"] = _ =>
            {
                string query = Request.Query.query.HasValue ? Request.Query.query : null;

                if (null == query) throw new InvalidOperationException("Ingenting å søke etter.");

                return Response.AsJson(documents.Search(query).Select(doc => DtoMaps.Map(doc, favorites, Context.GetUserInfo())).ToArray()).AsCacheable(DateTime.Now.AddHours(12));
            };
        }
Esempio n. 35
0
        public DocumentModuleTests()
        {
            _documentRepository = A.Fake<IRepository>();
            _imageRepository = A.Fake<IImageRepository>();
            _ratingRepository = A.Fake<IRatingRepository>();
            _reviewRepository = A.Fake<IReviewRepository>();
            _pathProvider = A.Fake<IEnvironmentPathProvider>();

            _browser = new Browser(with =>
            {
                with.Module<DocumentModule>();
                with.Dependency(_documentRepository);
                with.Dependency(_imageRepository);
                with.Dependency(_ratingRepository);
                with.Dependency(_reviewRepository);
                with.Dependency(_pathProvider);
                with.Dependency(A.Fake<IFavoritesRepository>());
            });
        }
Esempio n. 36
0
 public EPiSocialService(ICommentRepository commentRepository, IRatingRepository ratingRepository)
 {
     this.commentRepository = commentRepository;
     this.ratingRepository = ratingRepository;
 }
Esempio n. 37
0
 public RatingService(IRatingRepository repository)
 {
     _repo = repository;
 }
 public CandidateController(ICandidateRepository repo, IRatingRepository scoreRepo)
 {
     this.db = repo;
     this.ratings = scoreRepo;
 }
Esempio n. 39
0
 public RatingService(IRatingRepository ratingRepository)
 {
     this.ratingRepository = ratingRepository;
 }