开发者

best method for passing custom objects from class library to WCF to Client application and back again

开发者 https://www.devze.com 2023-01-30 05:04 出处:网络
here is my scenario: i have few custom object \"classes\".. like: Employee, EmployeeStatus, ContactDetail....etc.. these classes will be used as return types for WCF methods.. and will also be used i

here is my scenario:

i have few custom object "classes".. like: Employee, EmployeeStatus, ContactDetail....etc.. these classes will be used as return types for WCF methods.. and will also be used in the client side to be sent to WCF.. so far things are easy.. the hard part is.. i have to use the same classes in a separate class library that comes with the client.. and a class library that is supporting the WCF service.. i need to pass the same objects to all of these sides.. now how do I achieve that?? the reason i am using these class libraries is code re-usability.. for example the Employee class is used in 4 different WCFs and 4 different Clients (Win Apps, ASP.NET Pages)... also these class libraries will 开发者_开发问答be handling all DB stuff to these common objects.. now how do i achieve to make these classes available in all these clients and server sides... whats in my head is one solution.. i make one more class library that holds all these custom objects and add reference to it in all these projects... Will that work?? or is there a better solution?


Yes, having your data transfer objects (Employee, ContactDetail) and service interfaces in their own assemblies and then deploying them with the client(s) is what you will have to do in order for the clients to create a proxy to communicate with your WCF services.

0

精彩评论

暂无评论...
验证码 换一张
取 消