Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Closed Issue: DbUpdateException Serialization [1107]

$
0
0
I haven't dug into this one yet, but here is a small repro of an exception that comes from deserializing DbUpdateExceptions:

var formatter = new BinaryFormatter();

Exception ex;

using (var ms = new MemoryStream())
{
formatter.Serialize(ms, new DbUpdateException("foo"));
ms.Position = 0;

// Works fine
ex = (Exception)formatter.Deserialize(ms);
}

using (var ms = new MemoryStream())
{
formatter.Serialize(ms, ex);
ms.Position = 0;

// Exception happens here on 2nd deserialize
ex = (Exception)formatter.Deserialize(ms);
}

Thoughts?
Comments: unit test coverage is sufficient, closing

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>