ProxyBaseClasses (#27)

This commit is contained in:
Stef Heyenrath
2022-02-01 18:49:01 +01:00
committed by GitHub
parent 649ed89bb6
commit f9664e0564
45 changed files with 1305 additions and 836 deletions
@@ -1,11 +1,9 @@
using DifferentNamespace;
using System;
using System.Linq;
namespace ProxyInterfaceConsumer
{
[ProxyInterfaceGenerator.Proxy(typeof(Address))]
public partial interface IAddress
{
}
using DifferentNamespace;
namespace ProxyInterfaceConsumer
{
[ProxyInterfaceGenerator.Proxy(typeof(Address))]
public partial interface IAddress
{
}
}
@@ -1,7 +1,7 @@
namespace ProxyInterfaceConsumer
namespace ProxyInterfaceConsumer
{
[ProxyInterfaceGenerator.Proxy(typeof(ProxyInterfaceConsumer.PersonT<>))]
public partial interface IPersonT<T> where T : struct
public partial interface IPersonT //<T> where T : struct
{
}
}
@@ -15,16 +15,16 @@ namespace ProxyInterfaceConsumer
public static void Main()
{
IPersonT<int> pT = new PersonTProxy<int>(new PersonT<int>());
pT.TVal = 1;
Console.WriteLine(JsonSerializer.Serialize(pT, JsonSerializerOptions));
Console.WriteLine(new string('-', 80));
//IPersonT<int> pT = new PersonTProxy<int>(new PersonT<int>());
//pT.TVal = 1;
//Console.WriteLine(JsonSerializer.Serialize(pT, JsonSerializerOptions));
//Console.WriteLine(new string('-', 80));
IPersonTT<int, Program> pTT = new PersonTTProxy<int, Program>(new PersonTT<int, Program>());
pTT.TVal1 = 42;
pTT.TVal2 = new Program();
Console.WriteLine(JsonSerializer.Serialize(pTT, JsonSerializerOptions));
Console.WriteLine(new string('-', 80));
//IPersonTT<int, Program> pTT = new PersonTTProxy<int, Program>(new PersonTT<int, Program>());
//pTT.TVal1 = 42;
//pTT.TVal2 = new Program();
//Console.WriteLine(JsonSerializer.Serialize(pTT, JsonSerializerOptions));
//Console.WriteLine(new string('-', 80));
var ap = new AddressProxy(new Address { HouseNumber = 42 });
ap.HouseNumber = -1;
@@ -7,6 +7,13 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Compile Remove="IPersonT.cs" />
<Compile Remove="IPersonTT.cs" />
<Compile Remove="PersonT.cs" />
<Compile Remove="PersonTT.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2">