b95516a3dd
Former-commit-id: 73e3bb1e96dd09dc931c1dfe559d2c7f7b8b02c7
55 lines
685 B
C#
55 lines
685 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
class CA
|
|
{
|
|
public CB CB { get; set; }
|
|
public DeviceDetails DeviceDetails { get; set; }
|
|
}
|
|
|
|
class CB
|
|
{
|
|
public CB (string arg)
|
|
{
|
|
}
|
|
}
|
|
|
|
class DeviceDetails
|
|
{
|
|
public DeviceDetails (string arg)
|
|
{
|
|
}
|
|
}
|
|
|
|
class BB
|
|
{
|
|
public Task<string> GetUser()
|
|
{
|
|
return Task.FromResult ("aa");
|
|
}
|
|
|
|
public Task<string> GetDevice()
|
|
{
|
|
return Task.FromResult ("bb");
|
|
}
|
|
}
|
|
|
|
class X
|
|
{
|
|
BB bb = new BB ();
|
|
|
|
public async Task<CA> GetCAAsync()
|
|
{
|
|
return new CA
|
|
{
|
|
CB = new CB(await bb.GetUser()),
|
|
DeviceDetails = new DeviceDetails(await bb.GetDevice())
|
|
};
|
|
}
|
|
|
|
static void Main ()
|
|
{
|
|
var x = new X ();
|
|
x.GetCAAsync ().Wait ();
|
|
}
|
|
} |