Files
ProxyGenerator/src-examples/ProxyInterfaceConsumerViaNuGet/Program.cs
T
Stef Heyenrath 0f58ce480d Fix namespace (#1)
* Fix NS

* .
2021-07-25 19:22:24 +02:00

27 lines
785 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;
var add = p.AddAddress(ap);
Console.WriteLine("add = " + JsonSerializer.Serialize(add, JsonSerializerOptions));
p.AddAddress(new AddressProxy(new Address { HouseNumber = 1000 }));
Console.WriteLine(JsonSerializer.Serialize(p, JsonSerializerOptions));
}
}
}