FileContextCore icon indicating copy to clipboard operation
FileContextCore copied to clipboard

Dirty fix to support .NET6 and .NET7

Open ikijano opened this issue 3 years ago • 0 comments

Quick and dirty fix to support .NET6 and .NET7 when keeping EFCore version as is.

I haven't run massive tests but at least simple query doesn't throw when running on .NET6 or .NET7 I think this would fix #40

Before fix FileContextLinqOperatorProvider static constructor would throw following exception when trying query from simple dbset:

      System.TypeInitializationException: The type initializer for 'FileContextCore.Query.Internal.FileContextLinqOperatorProvider' threw an exception.
       ---> System.InvalidOperationException: Sequence contains more than one matching element
         at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
         at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)
         at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
         at FileContextCore.Query.Internal.FileContextLinqOperatorProvider..cctor() in C:\source\...\FileContextCore\FileContextCore\Query\Internal\FileContextLinqOperatorProvider.cs:line 175

ikijano avatar Jan 19 '23 19:01 ikijano