|
Is it possible to access POCOs using OData? If I do not include the IgnoreProperties statement, I receive the following error when invoking the OData service: The server encountered an error processing the request. The exception message is 'On data context type 'MyEntities', there is a top IQueryable property 'Orders' whose element type is not an entity type. Make sure that the IQueryable property is of entity type or specify the IgnoreProperties attribute on the data context type to ignore this property.'. I made my POCOs a "first class citizen" by creating a partial class. [IgnoreProperties("Orders")] //If this is removed, the OData service will not run
public partial class MyEntities : IdeaBlade.EntityModel.EntityManager {
public IdeaBlade.EntityModel.EntityQuery<Order> Orders {
get { return new IdeaBlade.EntityModel.EntityQuery<Order>("Orders", this); }
} } public partial class Order : IdeaBlade.EntityModel.IKnownType {
[Key]
public int OrderId { get; set; } } Any ideas?
|