Ejemplo n.º 1
0
 public static DbFunctionExpression GetReparentedValue(this DbExpression hierarchyIdValue, DbExpression oldRoot, DbExpression newRoot)
 {
     Check.NotNull(hierarchyIdValue, "hierarchyIdValue");
     Check.NotNull(oldRoot, "oldRoot");
     Check.NotNull(newRoot, "newRoot");
     return(EdmFunctions.InvokeCanonicalFunction("GetReparentedValue", hierarchyIdValue, oldRoot, newRoot));
 }
Ejemplo n.º 2
0
 /// <summary>
 ///     Creates a <see cref="DbFunctionExpression" /> that invokes the canonical 'GetDescendant' function with the
 ///     specified argument, which must have a HierarchyId result type.
 ///     The result type of the expression is Edm.HierarchyId.
 /// </summary>
 /// <param name="hierarchyIdValue"> An expression that specifies the hierarchyid value. </param>
 /// <param name="child1"> An expression that provides a hierarchyid value. </param>
 /// <param name="child2"> An expression that provides a hierarchyid value. </param>
 /// <returns> A new DbFunctionExpression that returns a hierarchyid. </returns>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="hierarchyIdValue" />
 ///     or
 ///     <paramref name="child1" />
 ///     or
 ///     <paramref name="child2" />
 ///     is null.
 /// </exception>
 /// <exception cref="ArgumentException">
 ///     No overload of the canonical 'GetDescendant' function accept an argument with the result type of
 ///     <paramref name="child1" />
 ///     and
 ///     <paramref name="child2" />
 ///     .
 /// </exception>
 public static DbFunctionExpression GetDescendant(this DbExpression hierarchyIdValue, DbExpression child1, DbExpression child2)
 {
     Check.NotNull(hierarchyIdValue, "hierarchyIdValue");
     Check.NotNull(child1, "child1");
     Check.NotNull(child2, "child2");
     return(EdmFunctions.InvokeCanonicalFunction("GetDescendant", hierarchyIdValue, child1, child2));
 }
Ejemplo n.º 3
0
 public static DbFunctionExpression GetAncestor(this DbExpression hierarchyIdValue, DbExpression n)
 {
     Check.NotNull(hierarchyIdValue, "hierarchyIdValue");
     Check.NotNull(n, "n");
     return(EdmFunctions.InvokeCanonicalFunction("GetAncestor", hierarchyIdValue, n));
 }
Ejemplo n.º 4
0
 public static DbFunctionExpression HierarchyIdGetRoot()
 {
     return(EdmFunctions.InvokeCanonicalFunction("HierarchyIdGetRoot"));
 }
Ejemplo n.º 5
0
        // HierarchyId ‘Static’ Functions

        /// <summary>
        ///     Creates a <see cref="DbFunctionExpression" /> that invokes the canonical 'HierarchyIdParse' function with the
        ///     specified argument, which must have a string result type.
        ///     The result type of the expression is Edm.HierarchyId.
        /// </summary>
        /// <param name="input"> An expression that provides the canonical representation of the hierarchyid value. </param>
        /// <returns> A new DbFunctionExpression that returns a new hierarchyid value based on the specified value. </returns>
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="input" />
        ///     is null.
        /// </exception>
        /// <exception cref="ArgumentException">
        ///     No overload of the canonical 'HierarchyIdParse' function accept an argument with the result type of
        ///     <paramref name="input" />
        ///     .
        /// </exception>
        public static DbFunctionExpression HierarchyIdParse(DbExpression input)
        {
            Check.NotNull(input, "input");
            return(EdmFunctions.InvokeCanonicalFunction("HierarchyIdParse", input));
        }
Ejemplo n.º 6
0
 /// <summary>
 ///     Creates a <see cref="DbFunctionExpression" /> that invokes the canonical 'IsDescendantOf' function with the
 ///     specified argument, which must have a HierarchyId result type.
 ///     The result type of the expression is Int32.
 /// </summary>
 /// <param name="hierarchyIdValue"> An expression that specifies the hierarchyid value. </param>
 /// <param name="parent"> An expression that provides a hierarchyid value. </param>
 /// <returns> A new DbFunctionExpression that returns an integer value. </returns>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="hierarchyIdValue" />
 ///     or
 ///     <paramref name="parent" />
 ///     is null.
 /// </exception>
 /// <exception cref="ArgumentException">
 ///     No overload of the canonical 'IsDescendantOf' function accept an argument with the result type of
 ///     <paramref name="parent" />
 ///     .
 /// </exception>
 public static DbFunctionExpression IsDescendantOf(this DbExpression hierarchyIdValue, DbExpression parent)
 {
     Check.NotNull(hierarchyIdValue, "hierarchyIdValue");
     Check.NotNull(parent, "parent");
     return(EdmFunctions.InvokeCanonicalFunction("IsDescendantOf", hierarchyIdValue, parent));
 }
Ejemplo n.º 7
0
 /// <summary>
 ///     Creates a <see cref="DbFunctionExpression" /> that invokes the canonical 'GetLevel' function.
 ///     The result type of the expression is Int32.
 /// </summary>
 /// <param name="hierarchyIdValue"> An expression that specifies the hierarchyid value. </param>
 /// <returns> A new DbFunctionExpression that returns the level of the given hierarchyid. </returns>
 /// <exception cref="ArgumentNullException">
 ///     <paramref name="hierarchyIdValue" />
 ///     is null.
 /// </exception>
 public static DbFunctionExpression GetLevel(this DbExpression hierarchyIdValue)
 {
     Check.NotNull(hierarchyIdValue, "hierarchyIdValue");
     return(EdmFunctions.InvokeCanonicalFunction("GetLevel", hierarchyIdValue));
 }