Returning multiple rows RRS feed

  • Question

  • Hi, i have a linq statement where i return a new object like 

    new CustomObject { id = name =

    files = table2.files


    where I have defined CustomObject as a .cs class.

    Now this works well for when the query returns only one id and one name. 

    But what if for that one object I wanted files to be an array or list of files? So that the linq query would populate files with all files returned from the query (it performs a join) and not just one!

    Wednesday, December 5, 2012 7:10 PM

All replies

  • Please show the LINQ statement also.

    "Premature optimization is the root of all evil." - Knuth

    If I provoked thought, please click the green arrow

    If I provoked Aha! please click Propose as Answer

    We are here to learn, to share knowledge, and to earn points; all in about equal measure.

    Wednesday, December 5, 2012 7:13 PM
  • Hi aspbegineer;

    Please post your query so that we will be able to give a solution that fits your needs or how to modify your query to give the results you need.


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Wednesday, December 5, 2012 8:35 PM