Subsonic linq using activerecord very slow compared to simplerepository
Posted
by skiik
on Stack Overflow
See other posts from Stack Overflow
or by skiik
Published on 2010-01-15T00:35:51Z
Indexed on
2010/04/16
4:13 UTC
Read the original article
Hit count: 359
Anyone know anything about why linq queries are about 6 times slower when querying using active record vs simplerepository? The below code runs 6 times slower than when i query the data using a simple repository. This code is executed 1000 times in a loop
Thanks in advance
string ret = "";
// if (plan == null)
{
plan =VOUCHER_PLAN.SingleOrDefault(x => x.TENDER_TYPE == tenderType);
}
if (plan == null)
throw new InvalidOperationException("voucher type does not exist." + tenderType);
seq = plan.VOUCHER_SEQUENCES.First();
int i = seq.CURRENT_NUMBER;
seq.CURRENT_NUMBER += seq.STEP;
seq.Save();
© Stack Overflow or respective owner