当前位置: 首页>>代码示例>>C#>>正文


C# IEdmEntitySet.FindNavigationTarget方法代码示例

本文整理汇总了C#中IEdmEntitySet.FindNavigationTarget方法的典型用法代码示例。如果您正苦于以下问题:C# IEdmEntitySet.FindNavigationTarget方法的具体用法?C# IEdmEntitySet.FindNavigationTarget怎么用?C# IEdmEntitySet.FindNavigationTarget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEdmEntitySet的用法示例。


在下文中一共展示了IEdmEntitySet.FindNavigationTarget方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestInitialize

        public void TestInitialize()
        {
            this.testModel = Test.OData.Utils.Metadata.TestModels.BuildTestModel();

            this.defaultContainer = this.testModel.EntityContainer;

            this.personSet = this.defaultContainer.FindEntitySet("Persons");
            this.personType = (IEdmEntityType)this.testModel.FindType("TestModel.Person");
            this.employeeType = (IEdmEntityType)this.testModel.FindType("TestModel.Employee");
            this.officeType = (IEdmEntityType)this.testModel.FindType("TestModel.OfficeType");
            this.addressType = (IEdmComplexType)this.testModel.FindType("TestModel.Address");
            this.metropolitanCitySet = this.defaultContainer.FindEntitySet("MetropolitanCities");
            this.metropolitanCityType = (IEdmEntityType)this.testModel.FindType("TestModel.MetropolitanCityType");
            this.boss = this.defaultContainer.FindSingleton("Boss");
            this.containedOfficeNavigationProperty = (IEdmNavigationProperty)this.metropolitanCityType.FindProperty("ContainedOffice");
            this.containedOfficeSet = (IEdmContainedEntitySet)metropolitanCitySet.FindNavigationTarget(this.containedOfficeNavigationProperty);
            this.containedMetropolitanCityNavigationProperty = (IEdmNavigationProperty)this.officeType.FindProperty("ContainedCity");
            this.containedMetropolitanCitySet = (IEdmContainedEntitySet)containedOfficeSet.FindNavigationTarget(this.containedMetropolitanCityNavigationProperty);
        }
开发者ID:larsenjo,项目名称:odata.net,代码行数:19,代码来源:ContextUriParserJsonLightTests.cs

示例2: GetEntitySet

 /// <summary>
 /// Gets the entity set for this segment.
 /// </summary>
 /// <param name="previousEntitySet">The entity set of the previous path segment.</param>
 /// <returns>
 /// The entity set for this segment.
 /// </returns>
 public override IEdmEntitySet GetEntitySet(IEdmEntitySet previousEntitySet)
 {
     if (NavigationProperty != null && previousEntitySet != null)
     {
         // Cast will fail in singleton / containment cases.
         return previousEntitySet.FindNavigationTarget(NavigationProperty) as IEdmEntitySet;
     }
     return null;
 }
开发者ID:tlycken,项目名称:aspnetwebstack,代码行数:16,代码来源:NavigationPathSegment.cs

示例3: GetTargetEntitySet

        /// <summary>
        /// Gets the target entity set for the given function import.
        /// </summary>
        /// <param name="functionImport">The function import.</param>
        /// <param name="sourceEntitySet">The source entity set.</param>
        /// <param name="model">The model.</param>
        /// <returns>The target entity set of the function import or null if it could not be determined.</returns>
        internal static IEdmEntitySet GetTargetEntitySet(this IEdmFunctionImport functionImport, IEdmEntitySet sourceEntitySet, IEdmModel model)
        {
            DebugUtils.CheckNoExternalCallers();
            IEdmEntitySet targetEntitySet;
            if (functionImport.TryGetStaticEntitySet(out targetEntitySet))
            {
                return targetEntitySet;
            }

            if (sourceEntitySet == null)
            {
                return null;
            }

            if (functionImport.IsBindable && functionImport.Parameters.Any())
            {
                IEdmFunctionParameter parameter;
                IEnumerable<IEdmNavigationProperty> path;
                if (functionImport.TryGetRelativeEntitySetPath(model, out parameter, out path))
                {
                    // TODO: throw better exception
                    WebUtil.CheckSyntaxValid(parameter == functionImport.Parameters.First());
                    targetEntitySet = sourceEntitySet;
                    foreach (var navigation in path)
                    {
                        targetEntitySet = targetEntitySet.FindNavigationTarget(navigation);
                        if (targetEntitySet == null)
                        {
                            return null;
                        }
                    }

                    return targetEntitySet;
                }
            }

            return null;
        }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:45,代码来源:PathParserModelUtils.cs

示例4: GetEntitySet

 /// <summary>
 /// Gets the entity set for this segment.
 /// </summary>
 /// <param name="previousEntitySet">The entity set of the previous path segment.</param>
 /// <returns>
 /// The entity set for this segment.
 /// </returns>
 public override IEdmEntitySet GetEntitySet(IEdmEntitySet previousEntitySet)
 {
     if (NavigationProperty != null && previousEntitySet != null)
     {
         return previousEntitySet.FindNavigationTarget(NavigationProperty);
     }
     return null;
 }
开发者ID:KevMoore,项目名称:aspnetwebstack,代码行数:15,代码来源:NavigationPathSegment.cs

示例5: FindNavigationTarget

        /// <summary>
        /// Finds the navigation target of this navigation property given a server entity set.
        /// </summary>
        /// <param name="sourceServerEntitySet">The source server entity set.</param>
        /// <returns>The navigation target or null if one couldn't be found.</returns>
        internal EdmEntitySetFacade FindNavigationTarget(IEdmEntitySet sourceServerEntitySet)
        {
            Debug.Assert(sourceServerEntitySet != null, "sourceServerEntitySet != null");

            // if no property could be found, then there is no way to get the target.
            if (this.serverProperty == null)
            {
                return null;
            }

            // find the target using the server property.
            IEdmEntitySet serverTarget = sourceServerEntitySet.FindNavigationTarget(this.serverProperty);
            if (serverTarget == null)
            {
                return null;
            }

            // if a target was found, wrap it in a new facade and return it.
            return this.modelFacade.GetOrCreateEntityContainerFacade(serverTarget.Container).GetOrCreateEntitySetFacade(serverTarget);
        }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:25,代码来源:EdmNavigationPropertyFacade.cs

示例6: IsAssociationSetRegistered

 public bool IsAssociationSetRegistered(IEdmEntitySet entitySet, IEdmNavigationProperty navigation)
 {
     return this.registeredAssociationSets.Any(s => s.Key == entitySet && s.Value == navigation) ||
            this.registeredAssociationSets.Any(s => s.Key == entitySet.FindNavigationTarget(navigation) && s.Value == navigation.Partner);
 }
开发者ID:AlineGuan,项目名称:odata.net,代码行数:5,代码来源:EdmToTaupoModelConverter.cs


注:本文中的IEdmEntitySet.FindNavigationTarget方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。