Convert Iqurable to strongly typed List or class RRS feed

  • Question

  • Hi,

    I am having linq query with select statement of multiple tables. Its returns as iquaryable.

    Here I need to convert that iqurable to custion entity class .




    Tuesday, August 9, 2011 6:10 AM


  • sorry your question doesnt make sense to me.

    IQueryable<T> is an interface that already allows to query for a specific entity type.

    If you mean with "custion entity class" as custom poco object that isnt part of your db model, you can use a simple linq query to return your entity out of the IQueryable (or whatever):


    from p in data select new CustomEntity { a1 = p.a1, a2 = p.a2, ... }




    • Marked as answer by Larcolais Gong Wednesday, August 17, 2011 5:52 AM
    Tuesday, August 9, 2011 8:00 AM