Add ProxyInterfaceConsumerViaNuGet project
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace ProxyInterfaceConsumer
|
||||
{
|
||||
class Program
|
||||
{
|
||||
private static JsonSerializerOptions JsonSerializerOptions = new ()
|
||||
{
|
||||
WriteIndented = true
|
||||
};
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
IPerson p = new PersonProxy(new Person());
|
||||
p.Name = "test";
|
||||
var ap = new AddressProxy(new Address { HouseNumber = 42 });
|
||||
p.Address = ap;
|
||||
p.AddAddress(ap);
|
||||
p.AddAddress(new AddressProxy(new Address { HouseNumber = 1000 }));
|
||||
|
||||
Console.WriteLine(JsonSerializer.Serialize(p, JsonSerializerOptions));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user