I need to define a WCF API to enable user to update large object. While I can define few smaller methods and let the user update specific parts of the large object at a time. But for some reason I am not able to do that. The other way I tried is defined the data contract as collection of key-value (key is an enum
and value is some string) and let the user add whatever he wants to update. This api very compact but it's not very intuitive and can be confusing for the user. Also since the value is of string type, so it's not very type safe.
So I now I have create one api, where the user can update the entire object. for example:
public UpdateResult UpdateAPI(UpdateParam param){}
Now the UpdateParam
class will several nullable fields.
Q: If there is a null value in one of the fields, how can differentiate at the server side, the null value was specified by the user or it's default non-specified one? Is there something in the incoming soap message that can help differentiate?
Any help would be greatly appreciated.
Similar questions asked are 1. Data member default values, how to figure out whether something was really sent? 2.