Пример #1
0
        /// <summary>
        /// Build a segment representing $each.
        /// </summary>
        /// <param name="navigationSource">The entity collection that this set-based operation applies to.</param>
        /// <param name="targetEdmType">Target type for the entity being referenced.</param>
        /// <exception cref="System.ArgumentNullException">Throws if any input parameter is null.</exception>
        /// <remarks>$each cannot be applied on singletons.</remarks>
        public EachSegment(IEdmNavigationSource navigationSource, IEdmType targetEdmType)
        {
            ExceptionUtils.CheckArgumentNotNull(navigationSource, "navigationSource");
            ExceptionUtils.CheckArgumentNotNull(targetEdmType, "targetEdmType");

            this.Identifier   = UriQueryConstants.EachSegment;
            this.SingleResult = false;
            this.TargetEdmNavigationSource = navigationSource;
            this.TargetEdmType             = targetEdmType;
            this.TargetKind = targetEdmType.GetTargetKindFromType();

            this.edmType = navigationSource.Type;
        }
Пример #2
0
 /// <summary>
 /// Build a segment to represent an unknown path or an open property.
 /// </summary>
 /// <param name="identifier">The identifier of the dynamic path segment.</param>
 /// <param name="edmType">the IEdmType of this segment</param>
 /// <param name="navigationSource">The navigation source targeted by this segment. Can be null.</param>
 /// <param name="singleResult">Whether the segment targets a single result or not.</param>
 public DynamicPathSegment(string identifier, IEdmType edmType, IEdmNavigationSource navigationSource, bool singleResult)
 {
     ExceptionUtils.CheckArgumentNotNull(identifier, "identifier");
     this.Identifier                = identifier;
     this.TargetEdmType             = edmType;
     this.SingleResult              = singleResult;
     this.TargetKind                = edmType == null ? RequestTargetKind.Dynamic : edmType.GetTargetKindFromType();
     this.TargetEdmNavigationSource = navigationSource;
 }