locked
Error when exposing LINQ to SQL entities RRS feed

  • Question

  • Hi

     

    I've created a simple data service class and specified my LINQ to SQL data context in the class declaration, e.g.:

     

       public class MyDataService : DataService<MyDataContext

     

    However I'm getting a runtime error:

     

    "The server encountered an error processing the request. The exception message is 'On data context type 'MyDataContext', there is a top IQueryable property 'Customers' 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've read on other threads that I have to decorate the entity classes with the DataServiceKey attribute - why is this? Why wasn't ADO.Net Data Services designed to support LINQ to SQL entities generated by the SQL Metal generator?

    It just seems a bit ludicrous that I have to add this attribute to the generated classes, when ADO.Net Data Services could have supported these entities as standard.

     

    Thanks in advance

     

    Andy

    Tuesday, September 23, 2008 1:10 PM

Answers

  •  

    We didn't get time to support Linq to Sql as a first class provider, as we did with entity framework. I agree, it would have been great, if we had done it, but due to time constraint in V1, we had to make some hard choices.

     

    Thanks

    Pratik

    Tuesday, September 23, 2008 5:24 PM
    Moderator

All replies

  •  

    We didn't get time to support Linq to Sql as a first class provider, as we did with entity framework. I agree, it would have been great, if we had done it, but due to time constraint in V1, we had to make some hard choices.

     

    Thanks

    Pratik

    Tuesday, September 23, 2008 5:24 PM
    Moderator
  • Are there any plans to provide an implementation of IUpdatable for LINQ-to-SQL?
    Thursday, September 25, 2008 2:27 PM