Azure / Azure/azure-functions-host
Cannot use dynamic queries using DbFunctions in Function apps
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
Function App Version 1.0.10 Cli
EF 6.0
System.Linq. Dynamic version 1.0.5840.25917
We are using dynamic linq queries that use DbFunctions method to execute queries using EF 6.
E.g.
var crit = "(CompletedOn == null || CompletedOn > DbFunctions.AddHours(DateTime.UtcNow, -960))"
dbContext.XYZItems.Where(crit)
The following exception occurs
No property or field 'DbFunctions' exists in type 'XYZ'
#### Expected behavior
The same exact code works fine from an asp.net WebApi 2.0 project.
* Programming language used - C#
Appreciate your help to resolve this issue.
Thanks
William
Contributor guide
Research direction
Reproduce the dynamic LINQ query in an Azure Function App v1.0.10 CLI project using EF 6.0 and System.Linq.Dynamic 1.0.5840.25917, then compare it with the working ASP.NET WebApi 2.0 behavior. Done means DbFunctions.AddHours can be used in the query without the “No property or field 'DbFunctions'” exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100