0

WebService と Dll (この Web サービスを使用するもの) にクラス (fe Automobile) があります。

class Automobile
{
    public string Model;
    public int MaxSpeed;
    public int Power
}

var result = Dll.GetAutomobile() // for example this method return Automobile
WebService.SaveAutomobile(result) // this method should take this argument

私はそのような方法でのみそれを作ることができます:

Dll.Automobile result = Dll.GetAutomobile() //instead var it's type(for understanding)

WebService.Automobile result2 = new WebService.Automobile();
result2.Model = result.Model;
result2.MaxSpeed = result.MaxSpeed;
result2.Power = result.Power;

直接作る方法はありresult2 = resultますか?

4

1 に答える 1