public ISession Get <TModel>(IDao <TModel> dao, string sessionAlias) { Type daoType = dao.GetType(); Type baseParameterizedType = baseDaoType.MakeGenericType(typeof(TModel)); bool isAssignableFrom = baseParameterizedType.IsAssignableFrom(daoType); if (!isAssignableFrom) { return(null); } ISessionProvider <TSession> sessionProvider = sessionProviderFactory.Build(sessionAlias); TSession session = sessionProvider.Current(); return(session); }
public ISession Get <TModel>(IDao <TModel> dao, string sessionAlias) { Type daoType = dao.GetType(); Type baseParameterizedType = typeof(ILuceneDao <TModel>); bool isAssignableFrom = baseParameterizedType.IsAssignableFrom(daoType); if (!isAssignableFrom) { return(null); } ISessionProviderFactory <LuceneSession <TModel> > sessionProviderFactory = serviceRegistry.Get <ISessionProviderFactory <LuceneSession <TModel> > >(); ISessionProvider <LuceneSession <TModel> > sessionProvider = sessionProviderFactory.Build(sessionAlias); LuceneSession <TModel> luceneSession = sessionProvider.Current(); return(luceneSession); }
public IQueryable <LogModel> FromParameter() { IQueryable <LogModel> result = logDao.GetAll(logSessionProvider.Current()); return(result); }