Пример #1
0
 public static System.Type GetRootType(this ICriteria criteria)
 {
     if (criteria is DetachedCriteriaAdapter)
     {
         DetachedCriteriaAdapter adapter = (DetachedCriteriaAdapter)criteria;
         return(GetRootType(adapter.DetachedCriteria, adapter.Session));
     }
     return(GetRootType(GetRootCriteria(criteria)));
 }
Пример #2
0
        public static string GetEntityOrClassName(this ICriteria criteria)
        {
            if (criteria is CriteriaImpl)
            {
                return(((CriteriaImpl)criteria).EntityOrClassName);
            }

            if (criteria is DetachedCriteriaAdapter)
            {
                DetachedCriteriaAdapter adapter = (DetachedCriteriaAdapter)criteria;
                return(adapter.DetachedCriteria.EntityOrClassName);
            }
            throw new NotSupportedException("criteria must be of type CriteriaImpl or DetachedCriteriaAdapter.");
        }