mirror of
https://github.com/zoriya/EntityFrameworkCore.Projectables.git
synced 2026-05-28 12:43:17 +00:00
Fixed property return types
This commit is contained in:
@@ -101,7 +101,6 @@ namespace EntityFrameworkCore.Projectables.Generator
|
|||||||
}
|
}
|
||||||
|
|
||||||
var returnType = returnTypeSyntaxRewriter.Visit(methodDeclarationSyntax.ReturnType);
|
var returnType = returnTypeSyntaxRewriter.Visit(methodDeclarationSyntax.ReturnType);
|
||||||
|
|
||||||
|
|
||||||
descriptor.ReturnTypeName = returnType.ToString();
|
descriptor.ReturnTypeName = returnType.ToString();
|
||||||
descriptor.Body = expressionSyntaxRewriter.Visit(methodDeclarationSyntax.ExpressionBody.Expression);
|
descriptor.Body = expressionSyntaxRewriter.Visit(methodDeclarationSyntax.ExpressionBody.Expression);
|
||||||
@@ -119,13 +118,9 @@ namespace EntityFrameworkCore.Projectables.Generator
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var returnTypeSymbol = semanticModel.GetSymbolInfo(returnTypeSyntaxRewriter.Visit(propertyDeclarationSyntax.Type)).Symbol;
|
var returnType = returnTypeSyntaxRewriter.Visit(propertyDeclarationSyntax.Type);
|
||||||
if (returnTypeSymbol is null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
descriptor.ReturnTypeName = returnTypeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
|
descriptor.ReturnTypeName = returnType.ToString();
|
||||||
descriptor.Body = expressionSyntaxRewriter.Visit(propertyDeclarationSyntax.ExpressionBody.Expression);
|
descriptor.Body = expressionSyntaxRewriter.Visit(propertyDeclarationSyntax.ExpressionBody.Expression);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user