If I change it to the following, it finds Evict but then fails to
save...
try
{
var doc = (object)session.Load<dynamic>(oldLayoutId);
session.Advanced.Evict<object>(doc);
session.Store(doc, newLayoutId);
session.SaveChanges();
}
catch (Exception ex)
{
var s = ex.ToString();
throw ex;
}
our objects are dynamic, so maybe we should use IDynamicJsonObject or
whatever for this???
Call stack/exception now is
Raven.Client.Exceptions.NonUniqueObjectException: Attempted to
associated a different object with id 'Layouts/RadioListLayout.v2'.
at
Raven.Client.Document.InMemoryDocumentSessionOperations.AssertNoNonUniqueInstance(Object
entity, String id) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight
\Document\InMemoryDocumentSessionOperations.cs:line 608
at
Raven.Client.Document.InMemoryDocumentSessionOperations.StoreInternal(Object
entity, Nullable`1 etag, String id) in c:\Builds\RavenDB-Stable
\Raven.Client.Lightweight\Document
\InMemoryDocumentSessionOperations.cs:line 584
at
Raven.Client.Document.InMemoryDocumentSessionOperations.Store(Object
entity, String id) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight
\Document\InMemoryDocumentSessionOperations.cs:line 532
[our calling code]
On Apr 4, 3:21 pm, "Oren Eini (Ayende Rahien)" <
aye...@ayende.com>