我在 WebService 和 Dll 中有课程(fe Automobile)(什么使用这个 Web 服务)。
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
吗?