Comments (4)
If possible, rebuild your question into a unit-test which can be included in the tests.
from system.linq.dynamic.core.
That would be difficult as I don't know how to do it. I'll try again though, this is perhaps a simpler example linq query (that works) that I want to do, but can it be done using the join extension using the string parameters?
IQueryable a = from zz in dyn2
join yy in dyn on dyn.Where(xx => xx.JobID == zz.JobID && xx.EventID == "EVENT2").Max(xy => xy.SQL_RFA) equals yy.SQL_RFA
select new { zz, yy };
from system.linq.dynamic.core.
I've downloaded your source and managed to write an example in the code similar to your join test. Here it is:
using System.Collections.Generic;
using System.Linq.Dynamic.Core.ConsoleTestApp.net452.Entities;
namespace System.Linq.Dynamic.Core.ConsoleTestApp.net452
{
class Program
{
static void Main(string[] args)
{
Person magnus = new Person() { id=1, name = "a" };
Person terry = new Person { id=2, name = "b" };
Pet barley = new Pet { id = 1, name = "1p1", personid = 1 };
Pet boots = new Pet { id = 2, name = "1p2", personid = 1 };
Pet whiskers = new Pet { id = 3, name = "2p1", personid = 2 };
var people = new List<Person> { magnus, terry };
var pets = new List<Pet> { barley, boots, whiskers };
//Act
var realQuery = people.AsQueryable().Join(
pets,
person =>
pets.Where(x => x.personid == person.id).Max(x => x.id),
pet => pet.id,
(person, pet) => new { OwnerName = person.name, Pet = pet.name });
var realResult = realQuery.ToArray();
var dynamicQuery = people.AsQueryable().Join(
pets,
"???",
"id",
"new(outer.name as OwnerName, inner.name as Pet)");
var dynamicResult = dynamicQuery.ToDynamicArray<DynamicClass>();
}
}
internal class Pet
{
public int id { get; set; }
public int personid { get; set; }
public string name { get; set; }
}
internal class Person
{
public int id { get; set; }
public string name { get; set; }
}
}
from system.linq.dynamic.core.
It's not possible to use external sub-query in a dynamic query.
from system.linq.dynamic.core.
Related Issues (20)
- How to get the value of the key, and access its value pair HOT 2
- How to use List<JObject>to complete multiple joins through strings, and how to implement multiple connection conditions? HOT 5
- out keyword is not working with dynamic linq HOT 1
- Unrecognize the Generic Type when parse the lambda expression string HOT 2
- The `DynamicLinqType` attribute can not be added to interfaces. HOT 3
- Collection operation not supported. HOT 1
- System.Linq.Dynamic.Core.Exceptions.ParseException: 'Enum type '..' not found' HOT 3
- An error is reported if the name is different HOT 4
- System.Linq.Dynamic.Core: No applicable method 'ArrayLength' exists in type HOT 1
- Getting Unhandled exception. '.' or '(' or string literal expected (at index 22) with a different propername HOT 1
- The LINQ expression 'InternalDbSet.Count()' could not be translated HOT 3
- Getting exception the binder 'System.Linq.Dynamic.Core.DynamicGetMemberBinder' needs at least one restriction. HOT 5
- Parameters of lambdas in the supplied expression have lower priority than defined types, even when casing differs HOT 3
- ParseException after update from v.1.0.8.18 to 1.0.9.0 or any newer (till 1.3.7) HOT 7
- Still yet ParseException after update from v.1.0.8.18 to 1.0.9.0 or any newer (till 1.3.7) HOT 12
- DynamicExpressionParser.ParseLambda HOT 1
- Cannot join with IQueryable`DynamicClass HOT 2
- Possible Memory Leak with ConstantExpressionHelper HOT 7
- No applicable method 'Datetime' exists in type from 1.3.6 version HOT 1
- Running into a ParseException in a WebGL build HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from system.linq.dynamic.core.