本文整理汇总了C#中IEdmModel.FindDeclaredEntityContainer方法的典型用法代码示例。如果您正苦于以下问题:C# IEdmModel.FindDeclaredEntityContainer方法的具体用法?C# IEdmModel.FindDeclaredEntityContainer怎么用?C# IEdmModel.FindDeclaredEntityContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEdmModel
的用法示例。
在下文中一共展示了IEdmModel.FindDeclaredEntityContainer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ODataFeedSerializerTests
public ODataFeedSerializerTests()
{
_model = SerializationTestsHelpers.SimpleCustomerOrderModel();
_customerSet = _model.FindDeclaredEntityContainer("Default.Container").FindEntitySet("Customers");
_customers = new[] {
new Customer()
{
FirstName = "Foo",
LastName = "Bar",
ID = 10,
},
new Customer()
{
FirstName = "Foo",
LastName = "Bar",
ID = 42,
}
};
_customersType = new EdmCollectionTypeReference(
new EdmCollectionType(
new EdmEntityTypeReference(
_customerSet.ElementType,
isNullable: false)),
isNullable: false);
_urlHelper = new Mock<UrlHelper>(new HttpRequestMessage()).Object;
_writeContext = new ODataSerializerWriteContext(new ODataResponseContext()) { EntitySet = _customerSet, UrlHelper = _urlHelper };
}
示例2: ODataFeedSerializerTests
public ODataFeedSerializerTests()
{
_model = SerializationTestsHelpers.SimpleCustomerOrderModel();
_customerSet = _model.FindDeclaredEntityContainer("Default.Container").FindEntitySet("Customers");
_customers = new[] {
new Customer()
{
FirstName = "Foo",
LastName = "Bar",
ID = 10,
},
new Customer()
{
FirstName = "Foo",
LastName = "Bar",
ID = 42,
}
};
_customersType = new EdmCollectionTypeReference(
new EdmCollectionType(
new EdmEntityTypeReference(
_customerSet.ElementType,
isNullable: false)),
isNullable: false);
_writeContext = new ODataSerializerContext() { EntitySet = _customerSet, Model = _model };
}
示例3: ODataCollectionSerializerTests
public ODataCollectionSerializerTests()
{
_model = SerializationTestsHelpers.SimpleCustomerOrderModel();
_customerSet = _model.FindDeclaredEntityContainer("Default.Container").FindEntitySet("Customers");
_edmIntType = EdmCoreModel.Instance.GetPrimitive(EdmPrimitiveTypeKind.Int32, isNullable: false);
_customer = new Customer()
{
FirstName = "Foo",
LastName = "Bar",
ID = 10,
};
ODataSerializerProvider serializerProvider = new DefaultODataSerializerProvider();
_collectionType = new EdmCollectionTypeReference(new EdmCollectionType(_edmIntType), isNullable: false);
_serializer = new ODataCollectionSerializer(serializerProvider);
}
示例4: ODataEntityTypeSerializerTests
public ODataEntityTypeSerializerTests()
{
_model = SerializationTestsHelpers.SimpleCustomerOrderModel();
_customerSet = _model.FindDeclaredEntityContainer("Default.Container").FindEntitySet("Customers");
_customer = new Customer()
{
FirstName = "Foo",
LastName = "Bar",
ID = 10,
};
ODataSerializerProvider serializerProvider = new DefaultODataSerializerProvider(_model);
_serializer = new ODataEntityTypeSerializer(new EdmEntityTypeReference(_customerSet.ElementType, isNullable: false), serializerProvider);
_urlHelper = new Mock<UrlHelper>(new HttpRequestMessage()).Object;
_writeContext = new ODataSerializerContext() { EntitySet = _customerSet, UrlHelper = _urlHelper };
}
示例5: ODataEntityTypeSerializerTests
public ODataEntityTypeSerializerTests()
{
_model = SerializationTestsHelpers.SimpleCustomerOrderModel();
_model.SetAnnotationValue<ClrTypeAnnotation>(_model.FindType("Default.Customer"), new ClrTypeAnnotation(typeof(Customer)));
_model.SetAnnotationValue<ClrTypeAnnotation>(_model.FindType("Default.Order"), new ClrTypeAnnotation(typeof(Order)));
_customerSet = _model.FindDeclaredEntityContainer("Default.Container").FindEntitySet("Customers");
_customer = new Customer()
{
FirstName = "Foo",
LastName = "Bar",
ID = 10,
};
_serializerProvider = new DefaultODataSerializerProvider();
_customerType = _model.GetEdmTypeReference(typeof(Customer)).AsEntity();
_serializer = new ODataEntityTypeSerializer(_serializerProvider);
_writeContext = new ODataSerializerContext() { EntitySet = _customerSet, Model = _model };
_entityInstanceContext = new EntityInstanceContext(_writeContext, _customerSet.ElementType.AsReference(), _customer);
}
示例6: ODataFeedSerializerTests
public ODataFeedSerializerTests()
{
_model = SerializationTestsHelpers.SimpleCustomerOrderModel();
_customerSet = _model.FindDeclaredEntityContainer("Default.Container").FindEntitySet("Customers");
_model.SetAnnotationValue(_customerSet.ElementType, new ClrTypeAnnotation(typeof(Customer)));
_customers = new[] {
new Customer()
{
FirstName = "Foo",
LastName = "Bar",
ID = 10,
},
new Customer()
{
FirstName = "Foo",
LastName = "Bar",
ID = 42,
}
};
_customersType = _model.GetEdmTypeReference(typeof(Customer[])).AsCollection();
_writeContext = new ODataSerializerContext() { EntitySet = _customerSet, Model = _model };
}
示例7: ODataEntityReferenceLinkSerializerTest
public ODataEntityReferenceLinkSerializerTest()
{
_model = SerializationTestsHelpers.SimpleCustomerOrderModel();
_customerSet = _model.FindDeclaredEntityContainer("Default.Container").FindEntitySet("Customers");
}