Note that there are some explanatory texts on larger screens.

plurals
  1. PORavenDB throws a JSON deserialisation error when retrieving document
    primarykey
    data
    text
    <p>I've just completed a round of refactoring of my application, which has resulted in my removing a project that was no longer required and moving its classes into a different project. A side effect of this is that my <code>User</code> class, which is stored in RavenDB, has a collection property of a type moved to the new assembly. As soon as I attempt to query the session for the <code>User</code> class I get a <code>Json</code> deserialisation error. The issue is touched upon <a href="https://stackoverflow.com/questions/11224248/ravendb-throws-casting-exception-after-models-namespace-change">here</a> but the answers don't address my issue. Here's the offending property:</p> <pre><code>{ "OAuthAccounts": { "$type": "System.Collections.ObjectModel.Collection`1[ [Friendorsement.Contracts.Membership.IOAuthAccount, Friendorsement.Contracts]], mscorlib", "$values": [] }, } </code></pre> <p><code>OAuthAccounts</code> is a collection property of <code>User</code> that used to map here:</p> <blockquote> <p>System.Collections.ObjectModel.Collection`1[[Friendorsement.Contracts.Membership.IOAuthAccount, Friendorsement.Contracts]]</p> </blockquote> <p>It now maps here:</p> <blockquote> <p>System.Collections.ObjectModel.Collection`1[[Friendorsement.Domain.Membership.IOAuthAccount, Friendorsement.Domain]]</p> </blockquote> <p><code>Friendorsement.Contracts</code> no longer exists. All of its types are now in <code>Friendorsement.Domain</code></p> <p>I've tried using <code>store.DatabaseCommands.StartsWith("User", "", 0, 128)</code> but that didn't return anything.</p> <p>I've tried looking at <code>UpdateByIndex</code> but not got very far with it:</p> <pre><code>store.DatabaseCommands.UpdateByIndex("Raven/DocumentsByEntityName", new IndexQuery {Query = "Tag:Users"}, new[] { new PatchRequest { // unsure what to set here } }); </code></pre> <p>I'm using Raven 2.0</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload