1

I am beginning the development of a WCF Data Service project. I received the infamous exception:

The exception message is 'On data context type 'DataClasses1DataContext', there is a top IQueryable property 'table1' 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 modified the partial class of my entity with the DataServiceKey attribute. However, I am still receiving the same error. How can I fix it?

Thanks!

1
  • 2
    Recently this happened to lot of people due to the fact that WCF Data Services used to ship in System.Data.Service.dll, but it ships in Microsoft.Data.Services.dll. So if you DataService<T> is from one of those, but the DataServiceKey attribute is from the other, it won't work. Commented Aug 28, 2012 at 20:35

1 Answer 1

1

Just like Vitek said, the solution has been to add refernces to Microsoft.Data.Services and Microsoft.Data.Services.Client to my project that uses the DataServiceKey attribute.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.