0
votes
1answer
42 views

List of class properties

I have ASP.NET MVC 4 application with one view model class and about 20 views representing this view model. This views differs only by fields which user can edit. I want to merge all that views to one ...
2
votes
4answers
93 views

send a whole lambda expression including : where, orderby , take, skip as an argument [duplicate]

I'm writing a layered ASP.Net Application which consist of Bussiness layer, Repository layer, service Layer... . In repository layer I'm using EntityFramework as ORM. In service layer, I want to pass ...
0
votes
1answer
33 views

'lambda expression' cannot be used it is not part of the ISO - 2 C# (Only Framework 2.0)

I am forced to downgrade an project from framework version 4.0 to version 2.0. The following code used to work without any problems: deleteButton.Click += ((sender1, e1) => DeleteAnswer(sender1, ...
1
vote
1answer
77 views

Error in referencing parameters in nested lambda expression in LINQ ASP.NET

For some reason I'm getting an error in Microsoft Visual Studio 2012 over the following code: students.Where(s => foreignStudents.Any(f => s.FirstName == f.FirstName && ...
1
vote
1answer
161 views

EF extension method: “This function can only be invoked from LINQ to Entities.”

I have made an extension method to EF entities: public static IEnumerable<T> WildcardSearch<T>(this IEnumerable<T> entity, string ...
0
votes
4answers
72 views

SQL expressions in EF using Lambda

I would like to know if something similar to this (linq to SQL) customers.Where(c => SqlMethods.Like(c.Name, "%john%")); is possible to do in Entity Framework. Preferably using lamba ...
0
votes
1answer
56 views

Wildcard search in using Lamda in EF

I have a search with optional arguments: string id1 = HttpContext.Current.Request["id1"]; string id2 = HttpContext.Current.Request["id2"]; List<Foo> list = context.Foo.Where(l => ...
0
votes
2answers
38 views

lambda contains in array

My array A may be returns array of age likes int [] A = {11,12,13} or int [] A = {14,15} or int [] A = {11,14} My Person table has column likes ID Name Age --------------------- 1 ...
0
votes
0answers
50 views

Expression trees resolving differently in 4.5 than in 3.5

I have recently upgraded a .NET 3.5 web app to .NET 4.5. In part of the app we build a predicate to query data in the cache and add the filters(appending to a predicate). Sometimes I might add the ...
0
votes
2answers
88 views

Use lambda/linq on structs

I have my constants in a class that looks like this: public partial class CODE { public struct Status { public const long Registered = 5; public const long Active = ...
2
votes
2answers
91 views

lambda inner join and select all

Here is how I inner join in lambda , var myObject = tableNames.Join(tableSchool, x => x.sID , s => s.schoolID , ( (x,s) => new { } ) ).ToList(); I have many fields in both tableNames ...
0
votes
0answers
30 views

Expression pointing to DateTime property is transformed into Convert(x.Timestamp)

I have the following code in my ASP.NET MVC application public static IHtmlString NameFor<T>(this HtmlHelper html, Expression<Func<T, object>> expression) { return ...
2
votes
5answers
68 views

Select all in lambda Where()

I know that this works: var result = someCollection.Select(x=>x); I'm after a similar result with the Where() method: var result = someCollection.Where(x=> someBool ? x : x.Key == 1); ...
2
votes
6answers
95 views

Sum a range of ints in a List

Let's say I have a List like this: List<string> _lstr = new List<string>(); _lstr.Add("AA"); _lstr.Add("BB"); _lstr.Add("1"); _lstr.Add("7"); ...
1
vote
1answer
65 views

Lambda expression. Get the first result by date, for each person

i have list<result> of result objects with these properties {person, score, regdate}. And i want to only select the first registered score from each person (so i get 1 result for each person, ...

1 2 3 4 5 7
15 30 50 per page