Questions tagged [linq-method-syntax]

49 questions
-1
votes
2 answers

An exception occurred with using LINQ method syntax (LINQ to SQL) in C#

I use Linq to Sql and method syntax of Linq in my code to query from database with all tables. And I met an weird exception today, this is the first time error occurred since I started to use L2S. There are two columns in database table. And the…
Vamos
  • 209
  • 2
  • 10
-1
votes
2 answers

Linq query with method syntax needed for two lists with type List

var fullMessagesList = new List(){ "This is Apple", "This is mango", "This is a Lemon", "This is a Orange" }; var partialMessagesList = new List(){ "Apple", "mango", }; I need a linq query with method syntax with returns "This is a…
Mysterious Jack
  • 621
  • 6
  • 18
-2
votes
1 answer

Do can I convert this query syntax linq expression to method syntax?

I've written this code to join two tables together from sql server, now I want to write this as in method syntax. How can I rewrite this code? LinqToLoginDataContext lnqdore = new LinqToLoginDataContext(); var f = (from k in lnqdore.Table_Years …
-3
votes
1 answer

linq convert query syntax to method syntax

How can I convert this query syntax to method syntax in linq: return (from x in db.Table1 join y in db.Table1 on x.ID equals y.ID - 1 where Convert.ToInt32(y.ID) >= Convert.ToInt32(x.ID) …
Laziale
  • 7,965
  • 46
  • 146
  • 262
1 2 3
4