예제 #1
0
        /// <summary>
        /// <paramref name="period"/>의 구간이 엔티티의 상하한 구간 (<paramref name="loExpr"/> ~ <paramref name="hiExpr"/> )과 겹치는지 검사하는 질의어를 추가합니다.
        /// </summary>
        /// <typeparam name="TRoot"></typeparam>
        /// <typeparam name="TSub"></typeparam>
        /// <param name="queryOver">QueryOver 인스턴스</param>
        /// <param name="period">기간</param>
        /// <param name="loExpr">하한값을 가지는 속성에 대한 표현식</param>
        /// <param name="hiExpr">상한값을 가지는 속성에 대한 표현식</param>
        /// <returns></returns>
        public static IQueryOver <TRoot, TSub> AddIsOverlap <TRoot, TSub>(this IQueryOver <TRoot, TSub> queryOver,
                                                                          ITimePeriod period,
                                                                          Expression <Func <TSub, object> > loExpr,
                                                                          Expression <Func <TSub, object> > hiExpr)
        {
            queryOver.ShouldNotBeNull("queryOver");

            var criterion = IsOverlapCriterion(period, loExpr, hiExpr);

            queryOver.UnderlyingCriteria.Add(criterion);
            return(queryOver);
        }
예제 #2
0
        /// <summary>
        /// <paramref name="value"/>가 상하한 구간을 나타내는 표현식의 값의 내부 영역에 있는지 검사하는 질의어를 추가합니다.
        /// </summary>
        /// <typeparam name="TRoot"></typeparam>
        /// <typeparam name="TSub"></typeparam>
        /// <param name="queryOver"></param>
        /// <param name="value"></param>
        /// <param name="loExpr"></param>
        /// <param name="hiExpr"></param>
        /// <returns></returns>
        public static IQueryOver <TRoot, TSub> AddInRange <TRoot, TSub>(this IQueryOver <TRoot, TSub> queryOver,
                                                                        object value,
                                                                        Expression <Func <TSub, object> > loExpr,
                                                                        Expression <Func <TSub, object> > hiExpr)
        {
            queryOver.ShouldNotBeNull("queryOver");

            var criterion = IsInRangeCriterion(value, loExpr, hiExpr);

            queryOver.UnderlyingCriteria.Add(criterion);
            return(queryOver);
        }
예제 #3
0
        public static Type GetRootType(this IQueryOver queryOver)
        {
            queryOver.ShouldNotBeNull("queryOver");

            return(queryOver.GetRootCriteria().GetRootType());
        }
예제 #4
0
 public static CriteriaImpl GetRootCriteria(this IQueryOver queryOver)
 {
     queryOver.ShouldNotBeNull("queryOver");
     return(queryOver.RootCriteria.GetRootCriteria());
 }
예제 #5
0
 /// <summary>
 /// <paramref name="queryOver"/>가 사용하는 <see cref="ISessionImplementor"/>을 반환합니다.
 /// </summary>
 /// <param name="queryOver"></param>
 /// <returns></returns>
 public static ISessionImplementor GetSession(this IQueryOver queryOver)
 {
     queryOver.ShouldNotBeNull("queryOver");
     return(queryOver.GetRootCriteria().GetSession());
 }