Questions tagged [system.linq.dynamic]

This is the Microsoft assembly for the .Net 4.0 Dynamic language functionality.

This is the Microsoft assembly for the .Net 4.0 Dynamic language functionality. Library can be found at https://www.nuget.org/packages/System.Linq.Dynamic.

19 questions
12
votes
5 answers

System.Linq.Dynamic and DateTime

I am using System.Linq.Dynamic to do custom where clauses from an ajax call in .Net MVC 1.0. It works fine for strings, int etc but not for DateTime, I get the exception cannot compare String to DateTime. The very simple test code is items =…
Matthew Hood
  • 958
  • 3
  • 13
  • 22
6
votes
0 answers

System.Linq.Dynamic: How to guarantee parameter order in Parse function?

In the code below I successfully use Microsoft's System.Linq.Dynamic in C# to evaluate string expressions similar to Javascript eval(). However, I cannot figure out how to guarantee that parameter names and corresponding values match when calling…
Zachary Scott
  • 20,968
  • 35
  • 123
  • 205
4
votes
2 answers

Mixing raw SQL with IQueryable for dynamic filter

In entity framework 6 is it possible to mix raw SQL generated dynamically with IQueryable like this: IQueryable tree_query = context.Trees.Where(t=>t.Height> 2); IEnumerable tree_additional_filter = context.Database.SqlQuery("SELECT…
Krk Črn
  • 134
  • 2
  • 8
3
votes
1 answer

how convert a complex query string to lambda expression with System.Linq.Dynamic.Core

I have a lambda expression like x => x.Property0 == "Z" && old.Any(y => y.Key0 == x.Key0 && y.Property0 != x.Property0) This expression is passed into the method as a string because it comes from a configuration file. That means I have to convert…
3
votes
2 answers

Linq.Dynamic FirstOrDefault() nested in OrderBy

I have the following Linq statement, which works totally fine: query = query.OrderBy(m => m.MATERIAL_TXT.Where(mt => mt.LANG == "EN").FirstOrDefault().LTEXT); Now I'm trying to make it dynamic by using the string based syntax from…
dagon
  • 65
  • 6
2
votes
0 answers

Using postgresql unaccent function in a dynamic linq query

According to: Query PostgreSQL with Npgsql and Entity Framework using unaccent I added the NuGet Library and everything works: var result = _context.Table.Where(h => _context.Unaccent(h.Description) == "GARCÍA"); But I don't know how to combine it…
2
votes
1 answer

.Net Core 3.1. Need Nested Group By item daily Quantity show

I want to nested group by . I take the order items weekly and group them by type name, then I want to collect the daily sales amount of the product with this type name and get the results as below. But I am making a mistake in the Linq query I did…
1
vote
1 answer

Dynamic Linq Filtering with Parent Property not working

I have question related to dynamic Linq. I have a class structure defined as below. public class UserProfile { public string FirstName { get; set; } public string LastName { get; set; } public int Age { get;…
1
vote
0 answers

Could not load file or assembly System.Linq.Dynamic.Core Version=1.0.15.0

Added System.Linq.Dynamic.Core Version=1.0.15.0 from nuget in current Asp.net core 1.1 project. Added required moethods in library but when method is called error is thrown as "Could not load file or assembly 'System.Linq.Dynamic.Core,…
Kenny
  • 819
  • 1
  • 9
  • 24
1
vote
2 answers

How to select specific fields from dynamic list using LINQ

I am trying to get the some specific fields from dynamic object with is actually a list of any class, this class contains various fields out of those fields I want to select some specific fields using LINQ, The fields which I want to select is also…
Neeraj Kumar Gupta
  • 2,157
  • 7
  • 30
  • 58
1
vote
1 answer

Linq exception on Provider.CreateQuery

Given this class: class SomeClass { public int SomeValue { get; set; } } The following list: var queryableData = new List() { new SomeClass{SomeValue=1 }, new SomeClass{SomeValue=2 }, new SomeClass{SomeValue=3 }, new…
John
  • 23
  • 9
1
vote
1 answer

Bitwise OrderBy in Dynamic Linq

I need to be able to perform a string based, bitwise, .OrderBy in dynamic linq. items = items.OrderBy(x => (x.Permissions & 65536) != 0); vs. items = items.Where("1==1" + where).OrderBy("Permissions & 65536 != 0") Is this even possible? I don't…
michaelb
  • 149
  • 2
  • 11
1
vote
2 answers

Dynamic linq backslash in where clause

I use System.Linq.Dynamic to query entities with dynamic 'where' expressions. I'm querying object that has property "newValue" of string type. Exemplary value would be : "{\"ProcessId\":764, \"ProcessLength\":1000}". I can't use == because I want…
robs23
  • 135
  • 1
  • 13
1
vote
2 answers

How to write a statement that generates a LIKE T-SQL statement in System.Linq.Dynamic

I am making use of System.Linq.Dynamic and for most of the time it works out great. However I'm trying to get a StartsWith which would generate something like Description LIKE 'test%' in T-SQL. What I don't seem to find, and documentation is…
Kris van der Mast
  • 16,343
  • 8
  • 39
  • 61
0
votes
1 answer

What is the correct syntax for projection of a child property in a System.Linq.Dynamic.Core Select

I am using System.Linq.Dynamic.Core v 1.2.24 to create a dynamic select statement when querying SQL Server via Entity Framework. This is sitting behind a GraphQL API and the intention is to make the database query as efficient as possible - only…
1
2