Add <auto-generated> (#24)
This commit is contained in:
@@ -32,7 +32,7 @@ namespace ProxyInterfaceSourceGenerator.FileGenerators
|
||||
var constructorName = $"{targetClassSymbol.Name}Proxy";
|
||||
|
||||
var file = new FileData(
|
||||
$"{pd.FileName}Proxy.cs",
|
||||
$"{pd.FileName}Proxy.g.cs",
|
||||
CreateProxyClassCode(pd.Namespace, targetClassSymbol, interfaceName, className, constructorName)
|
||||
);
|
||||
|
||||
@@ -41,7 +41,17 @@ namespace ProxyInterfaceSourceGenerator.FileGenerators
|
||||
return file;
|
||||
}
|
||||
|
||||
private string CreateProxyClassCode(string ns, INamedTypeSymbol targetClassSymbol, string interfaceName, string className, string constructorName) => $@"using System;
|
||||
private string CreateProxyClassCode(string ns, INamedTypeSymbol targetClassSymbol, string interfaceName, string className, string constructorName) => $@"//----------------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by https://github.com/StefH/ProxyInterfaceSourceGenerator.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
#nullable enable
|
||||
using System;
|
||||
using AutoMapper;
|
||||
|
||||
namespace {ns}
|
||||
@@ -65,7 +75,8 @@ namespace {ns}
|
||||
|
||||
{GeneratePrivateAutoMapper()}
|
||||
}}
|
||||
}}";
|
||||
}}
|
||||
#nullable disable";
|
||||
private string GeneratePrivateAutoMapper()
|
||||
{
|
||||
return _context.ReplacedTypes.Count == 0 ? string.Empty : " private readonly IMapper _mapper;";
|
||||
|
||||
Reference in New Issue
Block a user