c# - WCF passing a custom object to client and running it's methods -
this design technical question. i'm not sure doing right...
i have wcf api communicates db , passes person object (which defined in separate .dll) has both methods , attributes. object being sent wcf calling client.
i want call person's methods on client. understand these can not sent downstream api however, if reference same .dll wcf uses should able cast api person .dll person run methods?
i hope clear trying achieve.
thanks, sam
wcf supports ability re-use references included in project. in sense, can create contracts assembly (an assembly contains thin domain models (e.g. person
etc) can add own logic to.
you can add assembly both wcf service, , calling client projects, , instruct wcf re-use existing references. way, pulled service deserialised local copy of person
, not person
generated proxy, full instance, on can perform method calls.
don't forget through, marshalling value in case. changes make person
instance local client only, need pass upstream wcf service again (through serialisation) service recognise changes , act accordingly.
Comments
Post a Comment