Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EmailController" /> class.
 /// </summary>
 public UploadController(IUserInfo userinfo, IOptions <AppSettings> settings, IHostingEnvironment environment) : base(userinfo)
 {
     _env          = environment;
     _settings     = settings.Value;
     _blobSettings =
         _settings.BlobStorageProviders.FirstOrDefault(x => x.Provider == _settings.DefaultStorageProvider);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProfileController" /> class.
        /// </summary>
        /// <param name="userInfo">The user information.</param>
        /// <param name="settings">The settings.</param>
        /// <param name="serviceProvider">The service provider.</param>
        /// <param name="userProfileService">The country service.</param>
        /// <param name="cache">The cache.</param>
        public ProfileController(IUserInfo userInfo, IOptions <AppSettings> settings, IServiceProvider serviceProvider, IUserProfileService userProfileService, IMemoryCache cache)
            : base(userInfo)
        {
            _userProfileService = userProfileService;
            _cache        = cache;
            _cacheOptions = new MemoryCacheEntryOptions
            {
                Priority          = CacheItemPriority.NeverRemove,
                SlidingExpiration = TimeSpan.FromMinutes(30)
            };

            _blobSettings =
                settings.Value.BlobStorageProviders.FirstOrDefault(x => x.Provider == settings.Value.DefaultStorageProvider);
            _userProfileService.AddEventHandler(new RealTimeEventUserProfileEventsHandler(serviceProvider));
        }