Passing to service custom class instance in WCF

Posted by hgulyan on Stack Overflow See other posts from Stack Overflow or by hgulyan
Published on 2010-03-23T09:17:22Z Indexed on 2010/03/23 10:03 UTC
Read the original article Hit count: 533

Filed under:

Hi, I have my custom class Customer with its properties. I added DataContract mark above the class and DataMember to properties and it was working fine, but I'm calling a service class's function, passing customer instance as parameter and some of my properties get 0 values.

While debugging I can see my properties values and after it gets to the function, some properties' values are 0. Why it can be so?

There's no code between this two actions. DataContract mark workes fine, everything's ok. Any suggestions on this issue?

I tried to change ByRef to ByVal, but it doesn't change anything. Why it would pass other values right and some of integer types just 0?

Maybe the answer is simple, but I can't figure it out.

Thank You.

_ Public Class Customer Private Type_of_clientField As Integer = -1 _ Public Property type_of_client() As Integer Get Return Type_of_clientField End Get Set(ByVal value As Integer) Type_of_clientField = value End Set End Property End Class _ _

© Stack Overflow or respective owner

Related posts about wcf