/// <summary> /// Gets the application dto. /// </summary> /// <param name="appId">The app id.</param> /// <returns></returns> public static AppDto GetApplicationDto(Guid appId) { // Assign new cache key, specific for site guid and response groups requested //string cacheKey = CoreCache.CreateCacheKey("Expression", ExpressionId.ToString()); AppDto dto = null; // check cache first //object cachedObject = MarketingCache.Get(cacheKey); //if (cachedObject != null) // dto = (ExpressionDto)cachedObject; // Load the object if (dto == null) { AppAdmin admin = new AppAdmin(); admin.LoadByApplication(appId); dto = admin.CurrentDto; // Insert to the cache collection //MarketingCache.Insert(cacheKey, dto, MarketingConfiguration.CacheConfig.ExpressionCollectionTimeout); } dto.AcceptChanges(); return(dto); }
/// <summary> /// Gets the application dto. /// </summary> /// <param name="name">The name.</param> /// <returns></returns> public static AppDto GetApplicationDto(string name) { AppDto dto = null; // Load the object if (dto == null) { AppAdmin admin = new AppAdmin(); admin.LoadByApplication(name); dto = admin.CurrentDto; } dto.AcceptChanges(); return(dto); }