Method code in C # serialization

When an object is serialized (by forwarding sent over the wire), does the instance method code become serialized? Or are the fields of class instances just serialized?

I ask this because some of my objects have a great method and want to know that I should use DTO (data transfer objects) to send data over the wire.

I assume this is just data plus some version type data ... am I right?

thanks

+3
source share
2 answers

Methods are never serialized.

Re "fields" - ; BinaryFormatter ; "", BinaryFormatter, - MSDN ( ):

, . Windows (WCF).

- WCF: XmlSerializer + ; DataContractSerializer ..

DTO, ( ), DTO.


(edit/) , , BinaryFormatter - , ( ). ( ) , ... , , .

+2

, , . .

0

Source: https://habr.com/ru/post/1710465/


All Articles