Using ObjectDataSource (Dynamic) with LINQ RRS feed

  • Question

  • User300685930 posted

    So, I'm wanting to have my business logic in ObjectDataSources that return the results of LINQ queries.  That is, somehow, return something like returning a IQueryable, I don't want to use LinqDataSource, but get similar capablities.

    Tuesday, October 7, 2008 12:26 PM

All replies

  • User-1573490007 posted
    Don't think you can do that. ObjectDataSource is to return strongly typed data objects, as you probably know... Returning a IQueryable wouldn't make sense. You'll have to either return objects from LINQ queries executed in a DataObject, or use the LINQDataSource (its made for that :) ).
    Tuesday, October 7, 2008 12:29 PM
  • User660823006 posted

    As mentioned ObjectDataSource returns strongly typed objects. We are working on something very similar in the next version of the framework that gives you all the power of ObjectDataSource with all the power of IQueryable. We MIGHT have a pre-release version of this by the end of the montth. *HINT* :-)

    Tuesday, October 7, 2008 12:50 PM
  • User300685930 posted

    thank you Scott for the headsup!  I'll be patient.  It will make my life so much nicer to be able to return IQueryable from on ODS.  My strategy is to have as much in ODS's as I can and making them type safe by using LINQ (not ot mention the power of LINQ) just warms my heart.

    Hope to meet you at PDC if you make it.

    Tuesday, October 7, 2008 10:15 PM