Category LINQ
Where Clause using in LINQ to Entities
March 23, 2013 Category: LINQ
Comments:
Entity Model Name :
TestLinqDataContext db = new TestLinqDataContext();
var obj=from p in db. TagMasters
where p.TagCode == TextBox2.Text
select p;
Order by using in LINQ to Entities
March 23, 2013 Category: LINQ
Comments:
Entity Model Name :
TestLinqDataContext db = new TestLinqDataContext();
var detail = from p in db.TagMasters
orderby p.ExpirationDate descending
Joins and Group By using in LINQ to Entities
March 23, 2013 Category: LINQ
Comments:
Entity Model Name :
TestLinqDataContext db = new TestLinqDataContext();
var result = (from p in db.TagMasters
join
t in db.TagRegistrations on p.ID equals t.TagId
group t by new { p.TagCode, t.DateCreated } into g
select new { g.Key.TagCode,g.Key.DateCreated}).Distinct();
Top Operator using take in LINQ to Entities
March 23, 2013 Category: LINQ
Comments:
Entity Model Name :
TestLinqDataContext db = new TestLinqDataContext();
var topDate = db.TagMasters.Take(3);
Sub query in LINQ to Entities
March 23, 2013 Category: LINQ
Comments:
Entity Model Name :
TestLinqDataContext db = new TestLinqDataContext();
var innerQuery = (from fb in db. TagMasters orderby fb.ExpirationDate descending select fb.ExpirationDate).Take(3).Distinct();
var result = (from f in db.TagMasters
where innerQuery.Contains(f.ExpirationDate)
// Notice here, grouping by a constant value
group f by 1 into g
select g.Max(t => t.ExpirationDate) );
Like operator or using wildcards in LINQ to Entities
March 23, 2013 Category: LINQ
Comments:
Entity Model Name :
TestLinqDataContext db = new TestLinqDataContext();
var obj = from p in db.TagMasters
where SqlMethods.Like(p.TagCode, “%” + TextBox2.Text + “%”)
select new {
p.TagCode,p.Status,p.ExpirationDate
};
Calling an stored procedure using ADO.NET Entity Model (Entity Framework LINQ to SQL)
March 23, 2013 Category: ASP.NET, ENTITY FRAMEWORK, LINQ
Comments:
Introduction to LINQ
March 15, 2013 Category: LINQ
Comments: