My application requires me to extend the functionality provided by typed datasets. Basically, the dataset itself holds information about what has to be "filled()", from which table and using which query. Effectively the Dataset looks like this ...
public class MyDataSet:DataSet {
/* Autogenerated code to make it a typed dataset using the schema */
/* Declarations of all DataTables as private members. Again to support being Typed */
/* My Own variables and Methods that hold some important information about the dataset - Public properties as webservice doesn't return private members */
/* Definitions of the DataTables in this DataSet */
}
Even the DataTables that are part of this DataSet have been generated from the schema and include custom code to hold extra information about queries, column constraints and parent child info etc ... in the same pattern as the DataSet ... all Typed again ...
Now that I have defined the situation, here is my problem:
I have to populate this dataset from a webservice and then pass it back to the client. I am aware that webservices dont pass back objects, but only the public properties in an XML format. I thought, in this case I would just get the data from the webservice and then create my own instance of the "MyDataSet" class on the client side and copy over all the data that came from the webservice.
Unfortunately this also did not work as when the webservice is returning a class that inherits from "DataSet" it just returns the properties that are in the schema and not even the ones that i manually declared as public in the DataSet code.
Is it possible to write a typed dataset class that has properties other than those defined in the schema ... and be able to return it back from a webservice ... I am ready to copy the data returned into an instance of the custom class on the client side so that then i can use methods in the class as well ...