linq2db / linq2db.EntityFrameworkCore

Bring power of Linq To DB to Entity Framework Core projects
MIT License
462 stars 38 forks source link

Crash when enum type is byte #30

Closed brunolau closed 4 years ago

brunolau commented 4 years ago

I'm receiving a crash when there is an enum of a byte type in the entity model. I wasn't receiving these types of crashes in 2.0.0 version.

The exception type is: System.Reflection.AmbiguousMatchException: 'Ambiguous match found.'

Very simply the problem could be narrowed down as follows

class Program
{
    public enum CrashMe : byte
    {
        One = 1,
        Two = 2
    }
    static void Main(string[] args)
    {
        typeof(Decimal).GetConstructorEx(new[] { typeof(CrashMe) });
    }
}

I'm also attaching a repro-project EnumRepro.zip

I'm aware that this issue might go down to L2DB core, however I'm opening it here as there wasn't such problem with the 2.0.0 version [if you downgrade the package version in the repro project to 2.0.0. this problem disappears]

sdanyliv commented 4 years ago

@brunolau, it was regression in extension. Sorry about that, fixed in 2.0.4