Simple linq query to DB times out

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
6 years ago
Hello.

The following query times out.

public IEnumerable<int> GetOrderNumberForOrdersNotProcessed(string key, object value)
        {
            return (from a in _genericAttributeRepository.Table
                    where a.Key == key &&
                          a.Value == value.ToString()
                    select a.EntityId).ToList();
        }

Any idea why?

I need it so i can see if a order has been processed by an external source.
6 years ago
I can only suggest that you execute the 'equivalent' SQL (in a tool like SSMS) to see what happens...

SELECT EntityId FROM GenericAttribute WHERE [Key] = '...' and [Value] = '...'
6 years ago
There are a few things to check. Start by restarting your appPool. Check sql for any locks.

I highly recommend you download and install http://demo.prefix.io/. You can see slow queries as well as other http related stuff.
6 years ago
New York wrote:
I can only suggest that you execute the 'equivalent' SQL (in a tool like SSMS) to see what happens...

SELECT EntityId FROM GenericAttribute WHERE [Key] = '...' and [Value] = '...'


That works as it should.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.