Skip to content

Need support for EFCore order by #2

@newonejoe

Description

@newonejoe

Hi Kant,

I need your support about using EFCore with Linq. System.Linq.Queryable OrderBy.
I follow henz2020's repo to use Microsoft.Entitiframeworkcore in NativeAOT. I use hnez2020's generator to get rd.xml. Everything is fine. But when I insert orderby desending in the query. I got following exceptions:

  var targetRecord = await _context.ProductionRecords.OrderByDescending(e => e.DateTimeInWork).FirstOrDefaultAsync(e => e.JobKey == jobKey);
MakeGenericMethod() cannot create this generic method instantiation because no code was generated for it: 'System.Linq.Queryable.OrderByDescending<TopwinLogger.Model.ProductionRecord,System.DateTime>(System.Linq.IQueryable<TopwinLogger.Model.ProductionRecord>,System.Linq.Expressions.Expression<System.Func<TopwinLogger.Model.ProductionRecord,System.DateTime>>)'.   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0x113
   at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.get_MethodInvoker() + 0xa1
   at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.MakeGenericMethod(Type[]) + 0x183
   at TopwinLogger!<BaseAddress>+0x1a7db7f
   at TopwinLogger.Services.MikoService.<ProcessJobProgressUpdateAsync>d__12.MoveNext() + 0x1fa

Do you have any suggestions?

Brs

Joe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions