Relative Content

Linq

With and without Lambda Expression

var id = 1;var query =from user in database.Usersjoin invoice in database.Invoices on user.Id equals invoice.UserIdwhere user.Id == idselect new { User = user, Invoice = invoice };Here’s the same query, using Lambda Expression LINQ extension methods:var id = 1;var query = database.Users // your starting point – table in the “from” statement.Join(database.Invoices, // the […]