linq-expressions Questions
2
Solved
Has anybody got an idea of how to create a .Contains(string) function using Linq Expressions, or even create a predicate to accomplish this
public static Expression<Func<T, bool>> Or&l...
Lackluster asked 17/3, 2010 at 9:9
1
Solved
I want to set private fields using LINQ expressions. I have this code:
//parameter "target", the object on which to set the field `field`
ParameterExpression targetExp = Expression.Parameter(typeo...
Leucippus asked 22/8, 2015 at 16:35
3
Solved
I am storing some filter data in my table. Let me make it more clear: I want to store some where clauses and their values in a database and use them when I want to retrieve data from a database.
F...
Womera asked 21/8, 2015 at 7:59
1
Solved
I have tried to create a switch expression with System.Linq.Expressions:
var value = Expression.Parameter(typeof(int));
var defaultBody = Expression.Constant(0);
var cases1 = new[] { Expression.Sw...
Pice asked 6/2, 2015 at 7:37
2
Solved
I am trying to figure out if there is a way to force a C# expression to convert part of the expression to a value. I am calling a method that accepts an expression that defines a query. I have a se...
Rockel asked 18/5, 2015 at 16:12
1
Solved
I've read this answer and understood from it the specific case it highlights, which is when you have a lambda inside another lambda and you don't want to accidentally have the inner lambda also com...
Inutile asked 7/5, 2015 at 15:14
1
Solved
I have observed the following bizarre behavior, and want to see if anyone already came across the same. In fact, I did quite a bit of searching, but have not bumped in anything related as yet.
It ...
Jemy asked 16/3, 2015 at 18:5
1
Solved
Below expression compares property NAME with the value PETER.
ParameterExpression pe = Expression.Parameter(typeof(T), "x");
MemberExpression member = Expression.Property(pe, "name");
ConstantE...
Bail asked 16/3, 2015 at 11:11
3
Solved
I need to call properties that are determined at runtime through reflection and they are called at a high frequency. So I am looking for solution with optimal performance, which mean I'd probably a...
Laughry asked 14/1, 2015 at 12:37
1
I would like to specify a parameter that can accept a method without having to specify generic arguments to produce the MethodInfo of the given method.
For example, I'd like to write code like thi...
Rave asked 30/1, 2015 at 3:55
2
Solved
I have to design a solution for a task, and I would like to use something theoretically similar to C#'s ExpressionVisitor.
For curiosity I opened the .NET sources for ExpressionVisitor to have a l...
Johen asked 22/1, 2015 at 14:41
2
Solved
I have a few questions about the System.Linq.Expressions.LabelExpression and its ancillary classes and methods.
1) The documentation for the LabelExpression class reads thus:
Represents a label, ...
Corrinnecorrival asked 17/12, 2014 at 13:55
2
Solved
I'm creating a Validator<T> class. I'm attempting to implement the Linq SelectMany extension methods for my validator to be able to compose expressions using a Linq query and validate the fin...
Wiltshire asked 25/2, 2010 at 0:55
2
Solved
Below is a simple demonstration code of my problem.
[TestClass]
public class ExpressionTests
{
[TestMethod]
public void TestParam()
{
Search<Student>(s => s.Id == 1L);
GetStudent(1L...
Verona asked 6/9, 2014 at 22:27
2
Solved
I have some fairly complex Entity Framework queries throughout my codebase and I decided to centralize the logic into the models. Basically, picture a bunch of controllers with large queries and lo...
Submediant asked 19/6, 2014 at 21:10
2
Solved
i have one common grid view column filter method that filter grid view record with ColumnName and SearchText wise. here when i operate on nullable int datacolumn there is error thrown from this met...
Merlon asked 15/4, 2014 at 7:38
2
Solved
I just want to make Column Filter for grid view. Simple I just want to filter grid view column with some extra stuff. Here I have created one IQueryable that returns queryable result.
Here is my c...
Killigrew asked 10/3, 2014 at 9:14
1
Solved
I have two expressions that are built out at separate times, but need to be merged in order to get an accurate 'grouping' of a where clause. I did try this option, but I am using Entity Framework a...
Intranuclear asked 21/3, 2014 at 20:36
4
Solved
I'm looking to use LINQ for some searching routines and wanted to have some dynamic where clauses. So, for example, if a user wants to search by city or search by state, I would have a dynamic LINQ...
Fash asked 2/3, 2011 at 3:43
1
Solved
I wanna extract the Func<> from the following Expression :
Expression<Func<IQueryable<Entity>, IOrderedQueryable<Entity>>> order = q => q.OrderByDescending(c=>c.Fu...
Synthesize asked 4/12, 2013 at 6:33
2
Solved
I'm using this dynamic linq orderby function which I got from here.
This works fine with nested properties so I could do this:
var result = data.OrderBy("SomeProperty.NestedProperty");
The prob...
Abfarad asked 15/7, 2013 at 5:56
1
Solved
I am having a slight issue (more like an annoyance) with my property binding data access classes. The problem is that the mapping fails when there exists no column in the reader for corresponding p...
Valenza asked 7/11, 2013 at 16:21
1
Solved
The MSDN documentation states:
Expression.Quote
Method Creates a
UnaryExpression that represents an
expression that has a constant value
of type Expression.
I've been able to build predi...
Fujio asked 29/6, 2010 at 5:43
4
Solved
I've had a look at other questions similar to this one but I couldn't find any workable answers.
I've been using the following code to generate unique keys for storing the results of my linq queri...
Etalon asked 17/3, 2012 at 3:1
1
Solved
Question:
I have this C# program, that gets the value of field tablename of mytable.
And it works fine.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.For...
Beaman asked 5/6, 2013 at 12:7
© 2022 - 2024 — McMap. All rights reserved.