Fix namespace model provider
This commit is contained in:
parent
9ba01f0c35
commit
f999ac5929
|
@ -21,7 +21,6 @@ namespace BlueWest.EfMethods
|
|||
{
|
||||
private readonly List<SymbolDisplayPart> _ignoredNamespaces;
|
||||
|
||||
|
||||
public ImmutableArray<Diagnostic> Diagnostics { get; private set; }
|
||||
public EfMethodsModel? Model { get; private set; }
|
||||
protected Compilation Compilation { get; }
|
||||
|
@ -32,6 +31,8 @@ namespace BlueWest.EfMethods
|
|||
protected INamedTypeSymbol EfUpdateMethodsTypeSymbol { get; }
|
||||
protected INamedTypeSymbol EfAddMethodsTypeSymbol { get; }
|
||||
|
||||
protected INamedTypeSymbol EfGeneratorTypeSymbol { get; }
|
||||
|
||||
|
||||
|
||||
protected EfGeneratorContext(
|
||||
|
@ -46,6 +47,7 @@ namespace BlueWest.EfMethods
|
|||
SourceGenerationOptions = sourceGenerationOptions;
|
||||
TypeSyntax = typeSyntax;
|
||||
EfUpdateMethodsTypeSymbol = compilation.GetTypeByMetadataNameOrThrow(EfUpdateMethodsAttributeSource.FullyQualifiedName);
|
||||
EfGeneratorTypeSymbol = compilation.GetTypeByMetadataNameOrThrow(EfGeneratorAttributeSource.FullyQualifiedName);
|
||||
EfAddMethodsTypeSymbol = compilation.GetTypeByMetadataNameOrThrow(EfAddMethodsAttributeSource.FullyQualifiedName);
|
||||
AddUsingIfRequired(sourceGenerationOptions.SupportNullableStaticAnalysis, "System.Diagnostics.CodeAnalysis");
|
||||
}
|
||||
|
@ -260,10 +262,11 @@ namespace BlueWest.EfMethods
|
|||
// get containing class type information
|
||||
ClassDeclarationSyntax classDeclarationSyntax = (TypeSyntax as ClassDeclarationSyntax)!;
|
||||
|
||||
var classDeclarationTypeInfo = semanticModel.GetTypeInfo(classDeclarationSyntax);
|
||||
|
||||
// context name
|
||||
var dbContextName = classDeclarationSyntax.Identifier.ValueText;
|
||||
var namespaceDeclaration = classDeclarationSyntax.Parent as NamespaceDeclarationSyntax;
|
||||
var contextNamespace = namespaceDeclaration.Name.ToString();
|
||||
var contextNamespace = TypeSyntax.GetNamespace();
|
||||
var contextTypeFullName = $"{contextNamespace}.{dbContextName}";
|
||||
|
||||
|
||||
|
@ -600,8 +603,6 @@ namespace BlueWest.EfMethods
|
|||
private EfGetOneFromListModel ExtractEfGetOneFromListMethodsModel(MemberDeclarationSyntax uProperty, SemanticModel semanticModel, EfEntityDataModel entityDataModel)
|
||||
{
|
||||
|
||||
//SpinWait.SpinUntil(() => Debugger.IsAttached);
|
||||
|
||||
var efTypeofSymbols = GetEntityTypeSymbol(uProperty, EfGetOneFromListAttributeSource.AttributeName, semanticModel);
|
||||
var attributeSymbol = uProperty.GetAttribute(EfGetOneFromListAttributeSource.AttributeName);
|
||||
var keyPropertyName = ExtractNameOfMemberName(uProperty, EfGetOneFromListAttributeSource.AttributeName);
|
||||
|
|
|
@ -27,6 +27,9 @@ namespace BlueWest.EfMethods
|
|||
/// <inheritdoc />
|
||||
public void Execute(GeneratorExecutionContext context)
|
||||
{
|
||||
|
||||
//SpinWait.SpinUntil(() => Debugger.IsAttached);
|
||||
|
||||
try
|
||||
{
|
||||
var options = SourceGenerationOptions.From(context);
|
||||
|
|
Loading…
Reference in New Issue