Fix issue #4 (string?) (#15)

* #4

* Only replace if required

* fix

* private readonly IMapper _mapper;

* CRLF
This commit is contained in:
Stef Heyenrath
2021-07-26 16:24:30 +02:00
committed by GitHub
parent 6f9a29a4b7
commit 86ef9ede98
9 changed files with 396 additions and 354 deletions
@@ -1,28 +1,28 @@
namespace ProxyInterfaceSourceGenerator.FileGenerators
{
internal class ProxyAttributeGenerator : IFileGenerator
{
private const string ClassName = "ProxyAttribute";
public FileData GenerateFile()
{
return new FileData($"{ClassName}.cs", $@"using System;
namespace ProxyInterfaceGenerator
{{
[AttributeUsage(AttributeTargets.Interface)]
public class {ClassName} : Attribute
{{
public Type Type {{ get; }}
public bool ProxyAll {{ get; }}
public {ClassName}(Type type, bool proxyAll = false)
{{
Type = type;
ProxyAll = proxyAll;
}}
}}
}}");
}
}
namespace ProxyInterfaceSourceGenerator.FileGenerators
{
internal class ProxyAttributeGenerator : IFileGenerator
{
private const string ClassName = "ProxyAttribute";
public FileData GenerateFile()
{
return new FileData($"{ClassName}.cs", $@"using System;
namespace ProxyInterfaceGenerator
{{
[AttributeUsage(AttributeTargets.Interface)]
public class {ClassName} : Attribute
{{
public Type Type {{ get; }}
public bool ProxyAll {{ get; }}
public {ClassName}(Type type, bool proxyAll = false)
{{
Type = type;
ProxyAll = proxyAll;
}}
}}
}}");
}
}
}