コード例 #1
0
        public KeySegment(IEnumerable <KeyValuePair <string, object> > keys, IEdmEntityType edmType, IEdmNavigationSource navigationSource)
        {
            this.keys             = new ReadOnlyCollection <KeyValuePair <string, object> >(keys.ToList());
            this.edmType          = edmType;
            this.navigationSource = navigationSource;

            // Check that the type they gave us is related to the type of the set
            if (navigationSource != null)
            {
                UriParserErrorHelper.ThrowIfTypesUnrelated(edmType, navigationSource.EntityType(), "KeySegments");
            }
        }
コード例 #2
0
ファイル: KeySegment.cs プロジェクト: tapika/swupd
        public KeySegment(IEnumerable <KeyValuePair <string, object> > keys, IEdmEntityType edmType, IEdmEntitySet entitySet)
        {
            DebugUtils.CheckNoExternalCallers();
            this.keys      = new ReadOnlyCollection <KeyValuePair <string, object> >(keys.ToList());
            this.edmType   = edmType;
            this.entitySet = entitySet;

            // Check that the type they gave us is related to the type of the set
            if (entitySet != null)
            {
                UriParserErrorHelper.ThrowIfTypesUnrelated(edmType, entitySet.ElementType, "KeySegments");
            }
        }
コード例 #3
0
ファイル: TypeSegment.cs プロジェクト: tapika/swupd
        public TypeSegment(IEdmType edmType, IEdmEntitySet entitySet)
        {
            ExceptionUtils.CheckArgumentNotNull(edmType, "type");

            this.edmType   = edmType;
            this.entitySet = entitySet;

            this.TargetEdmType      = edmType;
            this.TargetEdmEntitySet = entitySet;

            // Check that the type they gave us is related to the type of the set
            if (entitySet != null)
            {
                UriParserErrorHelper.ThrowIfTypesUnrelated(edmType, entitySet.ElementType, "TypeSegments");
            }
        }
コード例 #4
0
        public TypeSegment(IEdmType edmType, IEdmNavigationSource navigationSource)
        {
            ExceptionUtils.CheckArgumentNotNull(edmType, "type");

            this.edmType          = edmType;
            this.navigationSource = navigationSource;

            this.TargetEdmType             = edmType;
            this.TargetEdmNavigationSource = navigationSource;

            // Check that the type they gave us is related to the type of the set
            if (navigationSource != null)
            {
                UriParserErrorHelper.ThrowIfTypesUnrelated(edmType, navigationSource.EntityType(), "TypeSegments");
            }
        }
コード例 #5
0
        public BatchReferenceSegment(string contentId, IEdmType edmType, IEdmEntitySetBase entitySet)
        {
            ExceptionUtils.CheckArgumentNotNull(edmType, "resultingType");
            ExceptionUtils.CheckArgumentNotNull(contentId, "contentId");
            if (!ODataPathParser.ContentIdRegex.IsMatch(contentId))
            {
                throw new ODataException(ODataErrorStrings.BatchReferenceSegment_InvalidContentID(contentId));
            }

            this.edmType   = edmType;
            this.entitySet = entitySet;
            this.contentId = contentId;

            this.Identifier                = this.ContentId;
            this.TargetEdmType             = edmType;
            this.TargetEdmNavigationSource = this.EntitySet;
            this.SingleResult              = true;
            this.TargetKind                = RequestTargetKind.Resource;

            if (entitySet != null)
            {
                UriParserErrorHelper.ThrowIfTypesUnrelated(edmType, entitySet.EntityType(), "BatchReferenceSegments");
            }
        }