/// <summary> /// Add a Sub Navigation Property to the current level of the query. /// </summary> /// <returns> /// NavPropsBuilder of TPropEnum, TQuery, TQueryBuilder, TNavPropEnum /// </returns> public NavPropsBuilder <TPropEnum, TQuery, TQueryBuilder, TNavPropEnum> Then <TSubNavPropEnum>(TSubNavPropEnum prop) where TSubNavPropEnum : struct, IComparable, IFormattable, IConvertible { if (NavigationProperties == null) { throw new InvalidOperationException("No navigation properties found to attach a sub navigation property."); } if (_current == null) { throw new InvalidOperationException("No navigation properties found to attach a sub navigation property."); } _current = _current.SubNavProp(prop); return(this); }
public NavProp SubNavProp <TNavPropEnum>(TNavPropEnum subNavPropEnum) where TNavPropEnum : struct, IComparable, IFormattable, IConvertible { if (NavProps == null) { NavProps = new NavProps(); } var navProp = new NavProp <TNavPropEnum>(subNavPropEnum); if (NavProps.Contains(navProp)) { return(NavProps.Get(navProp)); } NavProps.Add(navProp); return(navProp); }
/// <summary> /// Add a Navigation Property to the root level of the query. /// </summary> /// <returns> /// NavPropsBuilder of TPropEnum, TQuery, TQueryBuilder, TNavPropEnum /// </returns> public NavPropsBuilder <TPropEnum, TQuery, TQueryBuilder, TNavPropEnum> Append(TNavPropEnum prop) { if (NavigationProperties == null) { NavigationProperties = new NavProps(); } var newNavProp = new NavProp <TNavPropEnum>(prop); if (_current != null && _current.IntValue == newNavProp.IntValue) { return(this); } _current = newNavProp; NavigationProperties.Add(newNavProp); return(this); }
/// <summary> /// Add a Navigation Property to the root level of the query. /// </summary> /// <returns> /// NavPropsBuilder of TPropEnum, TQuery, TQueryBuilder, TNavPropEnum /// </returns> public NavPropsBuilder <TPropEnum, TQuery, TQueryBuilder, TNavPropEnum> Append(NavProp prop) { return(Append((TNavPropEnum)prop.Value)); }