i




 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
To make linq query faster
11-11-2015, 02:27 AM
Post: #1
To make linq query faster
Hi All,

How can I make following query execute faster. This query actually followed by two 'foreach' loops and another query inside. Database contains heaps of records, so it will be grateful if you could help me in executing this query faster.

Thank you in advance

var hours = from hr in objHours.Distinct()

where hr.AssignedId == assignId && hr.JobId == j.JID && hr.CatId == j.CatId.ToInt() && hr.Date.Year == DateTime.Now.Year
orderby hr.TID descending
select new

{

hr.Hour,

hr.Date,

hr.CatId

};


Quote


Possibly Related Threads...
Thread: Author Replies Views: Last Post
  To make linq query faster sarjfelix 0 938 11-11-2015 02:28 AM
Last Post: sarjfelix



User(s) browsing this thread: 1 Guest(s)