C# Type Conversion

Posted by PSU_Kardi on Stack Overflow See other posts from Stack Overflow or by PSU_Kardi
Published on 2010-06-02T18:50:10Z Indexed on 2010/06/02 18:54 UTC
Read the original article Hit count: 233

Hi guys, I have two objects. Object A and Object B.

Object A is an instance of a class that was generated from several XSD files. Used xsd.exe /c and compiled them. Now I have my new object.

I also have a web service, returning something very similar to object A. So right now I have something along the lines of this:

WebService.foo myResponseObj = MyService.GetObject(inData);
MyFramework.foo myClientObj = new MyFramework.foo();

What I want to do is this

myClientObj = (MyFramework.foo)myResponseObj

However, it's not really liking this. Says "Cannot implicitly convert MyFramework.foo[] to WebService.foo[]

Any ideas on how to resolve this? The object is quite large and they are basically identical.

© Stack Overflow or respective owner

Related posts about c#

Related posts about boxing