예제 #1
0
        public ObjectGetter(IRepository <int, OfferedObject> repository,
                            IPhotoUrlConstructor photoUrlConstructor,
                            IObjectImpressionsManager impressionsManager, ObjectQueryHelper queryHelper,
                            CurrentUserCredentialsGetter credentialsGetter, IConfiguration configs, IUserDataManager userDataManager)
        {
            _objectRepo        = repository;
            _photoConstructor  = photoUrlConstructor;
            _impressionManager = impressionsManager;
            _queryHelper       = queryHelper;

            ObjectDtoSelectExp = (o) => new ObjectDto
            {
                Id = o.OfferedObjectId,
                CountOfImpressions = o.Impressions.Count,
                CountOfViews       = 0,
                Description        = o.Description,
                Name    = o.Name,
                Rating  = null,
                OwnerId = o.OwnerLogin.UserId.ToString(),
                Photos  = o.Photos.Select(op => _photoConstructor.Construct(op)).ToList(),
                Tags    = o.Tags.Select(ot => ot.Tag.Name).ToList(),
                Type    = o.CurrentTransactionType,
            };
            _credentialsGetter = credentialsGetter;
            _configs           = configs;
            _userDataManager   = userDataManager;
        }
예제 #2
0
 public ProfilePhotoSaver(IImageSaver imageSaver,
                          CurrentUserCredentialsGetter userCredentialsGetter,
                          IRepository <int, ProfilePhoto> profileRepo)
 {
     _imageSaver            = imageSaver;
     _userCredentialsGetter = userCredentialsGetter;
     _profileRepo           = profileRepo;
 }
예제 #3
0
 public UserProfileGetter(IRepository <string, AppUser> userRepo,
                          ProfilePhotoUrlConstructor urlConstructor,
                          CurrentUserCredentialsGetter credentialsGetter)
 {
     _usersRepo         = userRepo;
     _urlConstructor    = urlConstructor;
     _credentialsGetter = credentialsGetter;
 }
 public ReturnTokenGenerator(IRepository <int, OfferedObject> objectsRepo, IRepository <Guid, ObjectReceiving> receivingsRepo, IRepository <Guid, ObjectRegistration> registrationsRepo, ITransactionTokenManager tokenManager, CurrentUserCredentialsGetter credentialsGetter, OwnershipAuthorization <Guid, ObjectRegistration> authorizer)
 {
     _objectsRepo       = objectsRepo;
     _receivingsRepo    = receivingsRepo;
     _registrationsRepo = registrationsRepo;
     _tokenManager      = tokenManager;
     _credentialsGetter = credentialsGetter;
     _authorizer        = authorizer;
 }
 public RegistrationTokenRefresher(IRepository <int, OfferedObject> objectsRepo,
                                   IRepository <Guid, ObjectRegistration> registrationsRepo,
                                   ITransactionTokenManager tokenManager,
                                   CurrentUserCredentialsGetter credentialsGetter)
 {
     _objectsRepo       = objectsRepo;
     _tokenManager      = tokenManager;
     _credentialsGetter = credentialsGetter;
     _registrationsRepo = registrationsRepo;
 }
예제 #6
0
 public ObjectDeleter(CurrentUserCredentialsGetter credentialsGetter,
                      IRepository <int, OfferedObject> objectsRepo,
                      ILogger <ObjectDeleter> logger,
                      IEventBus eventBus)
 {
     _credentialsGetter = credentialsGetter;
     _objectRepository  = objectsRepo;
     _logger            = logger;
     _eventBus          = eventBus;
 }
 public ObjectDetailsGetter(IRepository <int, OfferedObject> objectRepo,
                            IPhotoUrlConstructor photoConstructor,
                            IObjectViewsManager viewsManager,
                            ObjectQueryHelper queryHelper,
                            CurrentUserCredentialsGetter credentialsGetter)
 {
     _objectRepo        = objectRepo;
     _photoConstructor  = photoConstructor;
     _viewsManager      = viewsManager;
     _queryHelper       = queryHelper;
     _credentialsGetter = credentialsGetter;
 }
예제 #8
0
 public PhotoAdder(IImageSaver imageSaver,
                   CurrentUserCredentialsGetter credentialsGetter,
                   IRepository <int, OfferedObject> objectsRepo,
                   IRepository <int, ObjectPhoto> photoRepo,
                   OwnershipAuthorization <int, OfferedObject> authorizer)
 {
     _imageSaver        = imageSaver;
     _credentialsGetter = credentialsGetter;
     _objectsRepo       = objectsRepo;
     _photoRepo         = photoRepo;
     _authorizer        = authorizer;
 }
예제 #9
0
 public ObjectsOrderedGetter(IObjectQueryHelper queryHelper,
                             CurrentUserCredentialsGetter credentialsGetter,
                             IRepository <int, OfferedObject> objectRepo,
                             IPhotoUrlConstructor photoUrlConstructor,
                             IConfiguration configs, IUserDataManager userDataManager)
 {
     _queryHelper          = queryHelper;
     _credentialsGetter    = credentialsGetter;
     _objectRepo           = objectRepo;
     _photoUrlConstructor  = photoUrlConstructor;
     IncludeObjectLessThan = int.Parse(configs["Settings:IncludeObjectLessThan"]);
     _userDataManager      = userDataManager;
 }
 public CatalogAggregator(HttpClient httpClient,
                          HttpClientHelpers responseProcessor,
                          IConfiguration configs,
                          ILogger <CatalogAggregator> logger,
                          UserService userService,
                          CurrentUserCredentialsGetter credentialsGetter,
                          IMapper mapper, CommentAggregator commentAggregator)
 {
     _httpClient        = httpClient;
     _responseProcessor = responseProcessor;
     _configs           = configs;
     _logger            = logger;
     _userService       = userService;
     _credentialsGetter = credentialsGetter;
     _mapper            = mapper;
     _commentAggregator = commentAggregator;
 }
예제 #11
0
 public RegistrationsController(
     IUserDataManager userDataManager,
     IRepository <Guid, ObjectRegistration> registrationsRepo,
     ObjectDataManager objectDataManager,
     IRepository <Guid, ObjectReceiving> objectReceiving,
     IEventBus eventBus,
     ITransactionTokenManager tokenManager,
     int maximumHoursForFreeLending,
     int maximumHoursForReservationExpiration,
     CurrentUserCredentialsGetter credentialsGetter,
     OwnershipAuthorization <Guid, ObjectRegistration> ownershipAuth)
 {
     _userDataManager   = userDataManager;
     _registrationsRepo = registrationsRepo;
     _objectDataManager = objectDataManager;
     _objectReceiving   = objectReceiving;
     _eventBus          = eventBus;
     _tokenManager      = tokenManager;
     this.maximumHoursForFreeLending           = maximumHoursForFreeLending;
     this.maximumHoursForReservationExpiration = maximumHoursForReservationExpiration;
     _credentialsGetter = credentialsGetter;
     _ownershipAuth     = ownershipAuth;
 }
예제 #12
0
 public TransactionGetter(IRepository <Guid, ObjectRegistration> registrationsRepo, CurrentUserCredentialsGetter userGetter)
 {
     _registrationsRepo = registrationsRepo;
     _currentUserGetter = userGetter;
 }