I am consuming a WCF service from another company, and it is returning an object of type object
. Is there a reason not to return the actual class, and return an object that must be cast into the correct form?
For example, if the web service returns an object of type OrderStatus
, why would you instead return a plain old object
?
Correct me if I'm wrong, but this will require me to get the definition of the OrderStatus
class manually (via email or whatever), and put it in my solution. Plus, I will have to explicitly cast the object to an OrderStatus
object. Not to mention that the company could change the service to return an object of another type, and my code will stop working.
If the return value of the service was an object of type OrderStatus
, the class would be automatically generated for me right?