Comments (7)
I did create a unit-test which tests your scenario, but it seems to work fine.
Can you check the linked commit on this issue ?
from system.linq.dynamic.core.
Your test works fine because you are getting the type from first element in the IQueryable results.
This test should fail:
[Fact]
public void SkipTestForEqualElementType()
{
// Arrange
var testUsers = User.GenerateSampleModels(100).AsQueryable();
// Act
IQueryable results = testUsers.Where("Income > 10");
var skipResult = results.Skip(1).Take(5);
Assert.Equal(results.ElementType , skipResult.ElementType);
}
from system.linq.dynamic.core.
Checking another projects I found they are using IQueryable.Provider to create a query and seems to works fine. Maybe is a good aproach to solve this.
public static IQueryable Take(this IQueryable source, int count)
{
if (source == null) throw new ArgumentNullException("source");
return source.Provider.CreateQuery(
Expression.Call(
typeof(Queryable), "Take",
new Type[] { source.ElementType },
source.Expression, Expression.Constant(count)));
}
Class link: System.Linq.Dynamic
from system.linq.dynamic.core.
Thanks.
Issue is solved, new NuGet 1.0.6.0 is uploaded.
from system.linq.dynamic.core.
Great! I was checking it and works fine.
It would be interesting that Take method could take 0 value also, an return the IQueryable instead of an error. In my case, I'm using a variable as take index and sometimes is 0, and It's valid. Actually I have to check if take = 0 and set it as 1.
Good job!
from system.linq.dynamic.core.
New version added to NuGet
from system.linq.dynamic.core.
Works fine! thanks
from system.linq.dynamic.core.
Related Issues (20)
- ParseException ToString() does not contain stack trace HOT 1
- background HOT 1
- Doc: Method call in custom type raises "No applicable method '' exists in type ''" ParseException HOT 2
- UseParameterizedNamesInDynamicQuery set to true breaks `OfType` method call HOT 5
- Enhance filtering capabilities using enum namespace string HOT 1
- DateOnly.Parse Is not Supported HOT 4
- Like Operator: Unable to load one or more of the requested types. HOT 2
- Type from registered type has higher preference than input parameter expression with same name
- How can we do string interpolation using $? HOT 3
- Bug: WhereInterpolated() is not working for PropertyNames HOT 1
- Exception when trying to add/subtract types 'DateTime' and 'TimeSpan' HOT 3
- 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
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.