How to return relationships in a custom un-typed dataservice provider
Posted
by monkey_p
on Stack Overflow
See other posts from Stack Overflow
or by monkey_p
Published on 2010-06-08T10:07:02Z
Indexed on
2010/06/08
10:12 UTC
Read the original article
Hit count: 170
I have a custom .Net DataService and can't figure out how to return the data for relationships.
The data base has 2 tables (Customer, Address). A Customer can have multiple addresses, but each address can only have on customer.
I'm using Dictionary<string,object>
as my data type.
My question, for the following 2 urls how do i return the data.
http://localhost/DataService/Customer(1)/Address
http://localhost/DataService/Address(1)/Customer
For the none relational queries I return a List<Dictionary<string,object>>
So I imagined for the relation I should just populate the element with a either a Dictionary<string,object>
for the single ones and a List<Dictionary<string,object>>
for many relationships.
But this just gives me a NullRefferenceException
So what am I doing wrong?
© Stack Overflow or respective owner