Add ProxyInterfaceConsumerViaNuGet project

This commit is contained in:
Stef Heyenrath
2021-07-25 17:29:26 +02:00
parent 762f962e1d
commit a38d8c8ef0
13 changed files with 153 additions and 30 deletions
@@ -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));
}
}
}