locked
Do Linq to SQL data classes work with latest ADODS version? RRS feed

  • Question

  • When I try to create service methods that return IQueryable[myclass], I get a message that states:

    ... has a return type 'System.Linq.IQueryable`1[...]' 
    which is not supported for service operations.

    -bcc

    Monday, March 31, 2008 8:53 PM

Answers

  •  

    Yup, with the current bits, we fixed a bunch of problems that were present in the december CTP bit. Just to state few of them:

     

    1> Service Operations in december CTP used to only support single resource or collection of primitives as return type. In the current bits, we support single and collection values of primitive, complex types and entities.

     

    2> In december CTP bits, the code generation tools used to generate navigation properties as properties of string type. We fixed this issue in the current bits and now it generates nav properties with the actual entity type.

     

    3> We added the support of System.Data.Linq.Binary and System.Xml.Linq.XElement types, which was not present in december ctp bits.

     

    Hopefully beta1 bits will work with Linq-to-sql classes much more nicely.

     

    Thanks

    Pratik

    Monday, March 31, 2008 10:47 PM
    Moderator

All replies

  •  

    Yup, with the current bits, we fixed a bunch of problems that were present in the december CTP bit. Just to state few of them:

     

    1> Service Operations in december CTP used to only support single resource or collection of primitives as return type. In the current bits, we support single and collection values of primitive, complex types and entities.

     

    2> In december CTP bits, the code generation tools used to generate navigation properties as properties of string type. We fixed this issue in the current bits and now it generates nav properties with the actual entity type.

     

    3> We added the support of System.Data.Linq.Binary and System.Xml.Linq.XElement types, which was not present in december ctp bits.

     

    Hopefully beta1 bits will work with Linq-to-sql classes much more nicely.

     

    Thanks

    Pratik

    Monday, March 31, 2008 10:47 PM
    Moderator

  • Great News!

    Is what we played with at the MIX08 labs close to the beta bits? I noticed that when I used those assemblies that my Linq2Sql context/data suddenly were friendly with service methods, but then I lost the ability to use HttpContext.Current to get to custom items/HttpContext.Current.User -- so I switched back.

    I can't wait for beta bits!

    -bcc
    Monday, March 31, 2008 11:27 PM
  • Yup, the bits you played at the MIX were close, but we fixed a good number of bugs after that. So it should be better. But i am little confused with yr comment about losing the ability to use HttpContext.Current - what was the problem you were facing?

     

    Thanks

    Pratik

    Tuesday, April 1, 2008 3:26 AM
    Moderator
  • In the body of any service method, HttpContext.Current is always null using the MIX bits.
    Tuesday, April 1, 2008 5:17 AM
  • I found the problem:

    http://msdn2.microsoft.com/en-us/library/aa702682.aspx

    Turns out I didn't know that you had to set ASP.net compatibility mode to true.

    Code Snippet

    <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled=”true” />
    </system.serviceModel>


    Tuesday, April 1, 2008 4:18 PM