0

I'm having problems with my serializable class

[Serializable]
public class MyNameIsClass

All the properties are getting the default value (null or 0) when invoking from external sources. I deleted the [Serializable] tag and worked, but I need the class to be serializable so I can run this line:

System.IO.Stream stream = StreamHelper.SerializeToStream(myNameIsClassObject);

Is there another way to go through this problem?

Thank you all

GermanCH
  • 1
  • 3
  • When invoking are you creating an instance? – Max Cheetham Apr 19 '17 at 14:51
  • Possible duplicate of [Using Serializable attribute on Model in WebAPI](http://stackoverflow.com/questions/29962044/using-serializable-attribute-on-model-in-webapi) – Xeno-D Apr 19 '17 at 14:53
  • @MaxCheetham I'm using postman and sending the JSON as the body of the request. Basically I'm creating an instance when calling from the external source =) thank you! – GermanCH Apr 19 '17 at 14:54
  • @Xeno-D oops! thanks! I'll take a look at that! – GermanCH Apr 19 '17 at 14:55

0 Answers0