/// <summary> /// /// </summary> /// <param name="pRequest"></param> /// <returns></returns> public CacheDependencyResponse GetCacheDependencyInfo(CacheDependencyRequest cacheDependencyRequest) { try { List <string> surveyKeys = cacheDependencyRequest.Criteria.SurveyIdList; CacheDependencyResponse response = new CacheDependencyResponse(surveyKeys); Epi.Web.Interfaces.DataInterfaces.IDaoFactory entityDaoFactory = new EF.EntityDaoFactory(); Epi.Web.Interfaces.DataInterfaces.ICacheDependencyInfoDao cacheDependencyInfoDao = entityDaoFactory.CacheDependencyInfoDao; Epi.Web.BLL.CacheDependencyInfo cacheDependencyInfo = new Epi.Web.BLL.CacheDependencyInfo(cacheDependencyInfoDao); List <CacheDependencyBO> bo = cacheDependencyInfo.GetCacheDependencyInfo(surveyKeys); List <CacheDependencyDTO> dto = Mapper.ToDataTransferObject(bo); Dictionary <string, DateTime> dictionary = new Dictionary <string, DateTime>(); foreach (CacheDependencyDTO item in dto) { dictionary.Add(item.SurveyId, item.LastUpdate); } response.SurveyDependency = dictionary; return(response); } catch (Exception ex) { CustomFaultException customFaultException = new CustomFaultException(); customFaultException.CustomMessage = ex.Message; customFaultException.Source = ex.Source; customFaultException.StackTrace = ex.StackTrace; customFaultException.HelpLink = ex.HelpLink; throw new FaultException <CustomFaultException>(customFaultException); } }
public CacheDependencyResponse GetCacheDependencyInfo(CacheDependencyRequest request) { try { CacheDependencyResponse response = null;//(CacheDependencyResponse)_IDataService.GetCacheDependencyInfo(request); return(response); } catch (FaultException <CustomFaultException> cfe) { throw cfe; } catch (FaultException fe) { throw fe; } catch (CommunicationException ce) { throw ce; } catch (TimeoutException te) { throw te; } catch (Exception ex) { throw ex; } }
public CacheDependencyResponse GetCacheDependencyInfo(CacheDependencyRequest pRequest) { try { CacheDependencyResponse surveyInfo = null; surveyInfo = (CacheDependencyResponse)_iDataService.GetCacheDependencyInfo(pRequest); return(surveyInfo); } catch (FaultException <CustomFaultException> cfe) { throw cfe; } catch (FaultException fe) { throw fe; } catch (CommunicationException ce) { throw ce; } catch (TimeoutException te) { throw te; } catch (Exception ex) { throw ex; } }
static void InternalTimerCallback(object sender) { Epi.Web.WCF.SurveyService.IDataService dataService; dataService = new Epi.Web.WCF.SurveyService.DataService(); CacheDependencyRequest request = new CacheDependencyRequest(); request.Criteria.SurveyIdList = new List <string>(_reference.Keys); CacheDependencyResponse cacheDependencyResponse = (CacheDependencyResponse)dataService.GetCacheDependencyInfo(request); Dictionary <string, DateTime> response = cacheDependencyResponse.SurveyDependency; foreach (KeyValuePair <string, DateTime> kvp in response) { if (_reference.ContainsKey(kvp.Key)) { _reference[kvp.Key].ChangeIfGreater(kvp.Value); } else { DependencyReferenceToken dependencyUpdateToken = new DependencyReferenceToken(kvp.Value); _reference.Add(kvp.Key, dependencyUpdateToken); } } }
public void Insert(CacheDependencyResponse t) { throw new NotImplementedException(); }