Last post Jan 26, 2017 08:47 AM by PatriceSc
Jan 24, 2017 09:49 AM|tangara|LINK
I am now stuck cos I do not know if I should use Generic or just string for the serialized model that is needed for my Web service.
I have a Material Class so do I just bring in Material m or I have to separately use string MaterialName and do a get set ? or how ?
Hope to hear from someone soon.
Jan 25, 2017 09:46 PM|march11|LINK
Generic type is for flexibility, if you are certain your variable will always be strongly typed, no reason not to.
Jan 26, 2017 08:31 AM|tangara|LINK
In this case, the DataMember annotation do I then add it on the Generic Type class there ?
Or do I just bring in the class like this :
And then I do not need to repeat all the fields in Material.
Is that how it is done ?
Hope to hear from you soon.
Jan 26, 2017 08:47 AM|PatriceSc|LINK
My understanding is that you have an object member inside another object? If you mark it with DataMember it will be serialized based on what you applied to the Material type. If you tried something, discuss directly the error or the bad behavior you see.
Edit: and yes it's not related to WCF. If a member of a class is an object you just have available this exact class and all its members as part of the parent class.