Creating WCF DataContracts dynamically from code

Given the fact that I have a fully dynamic object model, that is, I don’t have specific classes defined anywhere in the code, but I still want to be able to create WCF DataContracts for them, so I can use them in operations. How can I achieve this?

My particular Entity class implements ICustomTypeDescriptor, which is used to represent various properties in the outside world, but my expeimentation with WCF assumes that WCF does not care about ICustomTypeDescriptor. Is this correct or am I missing something?

Is it possible? It may not be that the only way to create a DataContract is to actually have a specific encoding class, right?

+3
source share
3 answers

Things are evolving :-) Thanks to the excellent blog series from Alex D James it is very easy to implement this.

0
source

you can use the untyped service contract and IIRC post http://geekswithblogs.net/claeyskurt/archive/2008/09/24/125430.aspx

0
source

System.Reflection.Emit.

, . PropertyChanged, , .

, . http://drdobbs.com/184416570

0
source

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


All Articles