Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > WinFX General

Vista - converting of class

 
 
Old 07-18-2006   #1 (permalink)
R.A.B


 
 

converting of class

Im working on a big system. The business logic must be accessable for
several different communication ways. ex web service, RPC etc. It is
supose to be a framework where different communication modules can be
implimented by different persons.
I have designed an interface for the logic modules, where the input and
output is done through reply and request objects. These object is
native c# classes

Each communication type is located in its own module, and must take
care of the communication with its clients, and call the main
module,using the main modules data types.

Client (WS)-> WSService - > Common interface busineslogic

One of the communication clients use a WCF service.

The data comming in to the service and going on to the main module is
the same, except that they are in different namespaces, and the WCF
class contain a datacontract.

I don't want to use the Datacontract class inside the main module,
because its data should be completly independing of the communication
module, and the programmer should have there own way to communicate the
data.
sample classes

using System.Runtime.Serialization;

namespace namespace1 {
[DataContract]
class testClass {
[DataMember]
private string testString;

public string TestString {
get { return testString; }
set { testString=value; }
}
}
}

namespace namespace2 {
class testClass {
private string testString;
public string TestString {
get { return testString; }
set { testString=value; }
}
}
}


i would like to do this

namespace1.testClass t1 = new namespace1.testClass();
namespace2.testClass t2 = new namespace2.testClass();

t1 = t2;
Typecasting don't work.
The question is.. is there an way that i can transfer the data form one
class to another without having to manually transfering each property
of the class?. The structure of each class is exactly the same.


My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
When a class is both an inherited class of another, and alsoimplements an interface method .NET General
win32_pingstatus class / dns class PowerShell
Converting FROM .wma and .wav TO .mp3 using WMC 11 Vista music pictures video
Converting a .Wim To a ISO Vista General
Converting to PDF Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46