A question about the same definition object in the different namespaces.

  • Thread starter Thread starter simida
  • Start date Start date
S

simida

Hi, everyone,

I want to find a proper way to convert different object types in the
different namespaces.

such as

namespace A
{
class C
{
public string name;
public string address;
}
}

namespace B
{
class C
{
public string name;
public string address;
}
}

A.C ca = new A.C();

I want to like that B.C cb = (B.C) ca. but it is wrong!!!(Once I have
a more complex object definition).

I know that i can use XML serialization to convert it .LIKE use XSD to
generate class.

But can I have a elegant approach to do it?

Any suggestion will be welcome.

Sincerely,
simida
 
Yeah, I should keep interface isolation. I don't want others to read my
class directly.

namespaces resided in different projects. Although it duplicate class
definitions, Thay have different means in application logic lay. So, I
have to do this job for keeping interface isolation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top