koenbeuk / EntityFrameworkCore.Projectables

Project over properties and functions in your linq queries
MIT License
260 stars 17 forks source link

Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.QualifiedNameSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.SimpleNameSyntax' #100

Closed symbarh closed 4 months ago

symbarh commented 4 months ago

EntityFrameworkCore.Projectables.Generator.ProjectionExpressionGenerator is not generating ay files causing this error Generator 'ProjectionExpressionGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'InvalidCastException' with message 'Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.QualifiedNameSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.SimpleNameSyntax'

symbarh commented 4 months ago

narrowed the problem to this property

 [NotMapped]
 [Projectable]
 public PostType? PostType => Local.PostType.Ar | Local.PostType.GlCr | Local.PostType.GlDr;

where PostType is defined as

[Flags]
public enum PostType : byte
{
    Ar = 0b1,
    GlCr = 0b10,
    GlDr = 0b100
}