* #4 * Only replace if required * fix * private readonly IMapper _mapper; * CRLF
This commit is contained in:
@@ -7,17 +7,7 @@ namespace ProxyInterfaceSourceGenerator.Extensions
|
||||
{
|
||||
public static TypeEnum GetTypeEnum(this IPropertySymbol p)
|
||||
{
|
||||
if (p.Type.IsValueType || p.Type.ToString() == "string")
|
||||
{
|
||||
return TypeEnum.ValueTypeOrString;
|
||||
}
|
||||
|
||||
if (p.Type.TypeKind == TypeKind.Interface)
|
||||
{
|
||||
return TypeEnum.Interface;
|
||||
}
|
||||
|
||||
return TypeEnum.Complex;
|
||||
return GetTypeEnum(p.Type);
|
||||
}
|
||||
|
||||
public static TypeEnum GetTypeEnum(this IParameterSymbol p)
|
||||
@@ -27,7 +17,7 @@ namespace ProxyInterfaceSourceGenerator.Extensions
|
||||
|
||||
public static TypeEnum GetTypeEnum(this ITypeSymbol ts)
|
||||
{
|
||||
if (ts.IsValueType || ts.ToString() == "string")
|
||||
if (ts.IsValueType || ts.IsString())
|
||||
{
|
||||
return TypeEnum.ValueTypeOrString;
|
||||
}
|
||||
@@ -40,6 +30,11 @@ namespace ProxyInterfaceSourceGenerator.Extensions
|
||||
return TypeEnum.Complex;
|
||||
}
|
||||
|
||||
public static bool IsString(this ITypeSymbol ts)
|
||||
{
|
||||
return ts.ToString() == "string" || ts.ToString() == "string?";
|
||||
}
|
||||
|
||||
public static string ToPropertyText(this IPropertySymbol property, string? overrideType = null)
|
||||
{
|
||||
var get = property.GetMethod != null ? "get; " : string.Empty;
|
||||
|
||||
Reference in New Issue
Block a user