When invoking a query on the data service I get this error message inside the XML feed:
<m:error>
<m:code></m:code>
<m:message xml:lang="nl-NL">Internal Server Error. The type 'MyType' is not a complex type or an entity type.</m:message>
</m:error>
When I use the example described here in the article "How to: Create a Data Service Using the Reflection Provider (WCF Data Services)" http://msdn.microsoft.com/en-us/library/dd728281(v=VS.100).aspx it works as expected.
I have created the service in a .NET 4.0 web project. My data context class returns a query object that is derived from the LINQExtender (http://linqextender.codeplex.com/). When I execute the query object in a unit test, it works as expected.
My entity type is defined as:
[DataServiceKey("Id")]
public class Accommodation
{
[UniqueIdentifier]
[OriginalFieldName("EntityId")]
public string Id { get; set; }
[OriginalFieldName("AccoName")]
public string Name { get; set; }
}
(the UniqueIdentifier and OriginalFieldName attributes are used by LINQExtender)
Does anybody know if this is a bug in WCF data services or am I doing something wrong?