Files
ProxyGenerator/src-examples/ProxyInterfaceConsumerViaNuGet/Program.cs
T
2021-07-25 17:29:26 +02:00

25 lines
678 B
C#

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));
}
}
}