Ejemplo n.º 1
0
        public static async Task <IEnumerable <BaseEntity> > GetOrSetCacheEntry
            (IPropertyViewModelService propertyViewModelService,
            IMemoryCache cache,
            CacheKey key)
        {
            IEnumerable <BaseEntity> result;

            if (!cache.TryGetValue(key, out result))
            {
                switch (key)
                {
                case CacheKey.Property:
                    result = await propertyViewModelService.GetPropertyTypes();

                    break;

                case CacheKey.Location:
                    result = await propertyViewModelService.GetEstateLocations();

                    break;
                }

                var options = new MemoryCacheEntryOptions().SetAbsoluteExpiration(DateTime.Now.AddMinutes(30));
                cache.Set(key, result, options);
            }

            return(result);
        }
Ejemplo n.º 2
0
 public ProfileController(IPropertyViewModelService propertyViewModelService,
                          IProfileViewModelService profileViewModelService,
                          UserManager <ApplicationUser> userManager)
 {
     _propertyViewModelService = propertyViewModelService;
     _profileViewModelService  = profileViewModelService;
     _userManager = userManager;
 }
Ejemplo n.º 3
0
 public RecommendedViewComponent(IPropertyRecommender propertyRecommender,
                                 IPropertyViewModelService propertyViewModelService,
                                 UserManager <ApplicationUser> userManager)
 {
     _propertyRecommender      = propertyRecommender;
     _propertyViewModelService = propertyViewModelService;
     _userManager = userManager;
 }
Ejemplo n.º 4
0
 public PropertyController(IMemoryCache cache,
                           IPropertyViewModelService propertyViewModelService,
                           IProfileViewModelService profileViewModelService,
                           UserManager <ApplicationUser> userManager)
 {
     _cache = cache;
     _propertyViewModelService = propertyViewModelService;
     _profileViewModelService  = profileViewModelService;
     _userManager = userManager;
 }
Ejemplo n.º 5
0
 public LatestViewComponent(IPropertyViewModelService propertyViewModelService)
 {
     _propertyViewModelService = propertyViewModelService;
 }