本文整理汇总了C#中Microsoft.OData.Edm.Library.EdmEntityContainer.FindEntitySet方法的典型用法代码示例。如果您正苦于以下问题:C# EdmEntityContainer.FindEntitySet方法的具体用法?C# EdmEntityContainer.FindEntitySet怎么用?C# EdmEntityContainer.FindEntitySet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Edm.Library.EdmEntityContainer
的用法示例。
在下文中一共展示了EdmEntityContainer.FindEntitySet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AmbiguousEntitySetTest
public void AmbiguousEntitySetTest()
{
EdmEntityContainer container = new EdmEntityContainer("NS1", "Baz");
IEdmEntitySet set1 = new StubEdmEntitySet("Foo", container);
IEdmEntitySet set2 = new StubEdmEntitySet("Foo", container);
IEdmEntitySet set3 = new StubEdmEntitySet("Foo", container);
container.AddElement(set1);
Assert.AreNotEqual(set3, container.FindEntitySet("Foo"), "Checking the object equality.");
Assert.AreEqual(set3.Name, container.FindEntitySet("Foo").Name, "Checking the object equality.");
container.AddElement(set2);
container.AddElement(set3);
IEdmEntitySet ambiguous = container.FindEntitySet("Foo");
Assert.IsTrue(ambiguous.IsBad(), "Ambiguous binding is bad");
Assert.AreEqual(EdmContainerElementKind.EntitySet, ambiguous.ContainerElementKind, "Correct container element kind");
Assert.AreEqual("NS1.Baz", ambiguous.Container.FullName(), "Correct container name");
Assert.AreEqual("Foo", ambiguous.Name, "Correct Name");
Assert.IsTrue(ambiguous.EntityType().IsBad(), "Association is bad.");
}