I need to create a file csvthat will contain all current subscribers, as well as a series of lines that come from the database.
to get all the subscribers that I follow:
public IQueryble<Subscribers> ListAllSubscribersByCalendarId(Decimal cid)
{
return db.Subscribers.Where(x => x.calendar_id.Equals(cid));
}
pretty simple.
the problem is that I already have more than 5000 , and this one takes forever (literally)!
even showing only the last 30 entries takes a long time, my request is:
public IQueryble<Subscribers> ListLast30SubscribersByCalendarId(Decimal cid)
{
return db.Subscribers
.Where(x => x.calendar_id.Equals(cid))
.Take(30)
.OrderByDescending(x => x.created_date);
}
What can I do to speed up this process?
source
share