Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need support for EFCore order by #2

Open
newonejoe opened this issue Jul 1, 2022 · 1 comment
Open

Need support for EFCore order by #2

newonejoe opened this issue Jul 1, 2022 · 1 comment

Comments

@newonejoe
Copy link

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

@kant2002
Copy link
Owner

kant2002 commented Jul 3, 2022

@newonejoe Usually if something is missing, you write RD.xml file by yourself. If something can be generalized, would be good to contribute back to the project. Right now you can take a look at 625eaf0 and grab latest version. You would need latest Microsoft.EntitiframeworkCore.rd.xml and System.Linq.Queryable.rd.xml

@hez2010 you may find this is interesting to add support for navigation properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants