Redis .StoreAll An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

Go To StackoverFlow.com

0

I´m using Redis, but the StoreAll doesn´t work.

An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll

var newOrders = (from i in DB.Produtoes.OrderByDescending(d => d.idProduto) select i);
using (var produtosRedis = redisClient.GetTypedClient<Produto>())
{
    produtosRedis.StoreAll(newOrders);
}
2012-04-05 16:02
by Fernando JS


2

What you've encountered is a circular reference caused by the Json serialization used by StoreAll().

These posts will help you:

  1. Preventing StackOverflowException while serializing EF object graph into Json
  2. EntityFramework to Json workaround?
2012-04-06 06:46
by Ofer Zelig
Ads