Subsonic 3 : get only certain columns
Posted
by CTGA
on Stack Overflow
See other posts from Stack Overflow
or by CTGA
Published on 2010-04-28T00:50:30Z
Indexed on
2010/04/28
0:53 UTC
Read the original article
Hit count: 276
Hello,
I use : Subsonic 3, SQL Server 2008, Json.Net
Here is my problem :
I have a house table with id,lot number, address, location, ownerid and an owner table with id,name, description.
I'd like to get only the owner name and address of house where location is "San Francisco".
How can I do this with Subsonic?
My problem is I can only get a typed list or a datareader, I don't understand how to only get an array or a simple list.
What is the best solution? Create a custom class ? Create a View ? Anything else ?
My aim is to then serialize the data to send it back to my application, but serialization is seriously long because of the numerous relationships (My example here is simplified, there are indeed : house - owner - city - country etc.), whereas I need only 2 fields...
Thank you
© Stack Overflow or respective owner