I read articles about the benefits of sending serialized objects through network. Performance and size cost.
Some explained about DataContract and using JSON or XML serialization.
But I can't find articles about what happens if I don't use these attributes and I return a object assuming that my object's properties and states are of primitive types. Obviously when I use a serializer like DataContractJsonSerializer and its WriteObject method concretely, it's gonna throw an exception.
What would happen if I return for example in a web service method, an object of Employee type which has the attribute 'Serializable'. I mean what would .net would treat this result.
[WebMethod]
public Employee SendEmployeeData()
{
}
The object would be sent through network as binary stream or what?
Is it required to serialize an object to send it throught network?
I also read that DataContractSerializer would interpret the Serializable attribute.
difference between DataContract attribute and Serializable attribute in .net