Try our conversational search powered by Generative AI!

NullReference in Dynamic Datastore: difference in GetStore(Type type) and GetStore(string storeName)

Vote:
 

I'm working on a Dynamic Datastore plugin and got a NullReferenceException today when trying to load the store using the type:

Type t = Type.GetType(storeType);
var store = DynamicDataStoreFactory.Instance.GetStore(t);

The store definitely has some data already; I was changing some of the properties of the class yesterday and I feel this might be causing this issue.
Then I noticed that I can workaround this issue by passing the Type name (string) instead of the Type itself:

var store = DynamicDataStoreFactory.Instance.GetStore(storeType);

Using this overload my plugin loads just fine....

So now I'm wondering:

  1. what can be causing the NullReferenceException?
  2. how can I check if my model in the store is still correct?
    I am using [EPiServerDataStore(AutomaticallyRemapStore = true)] and my class implements IDynamicData
    Is there another way to force an update of my model in the store?
  3. what is the difference in the 2 overloads for GetStore()?

Episerver 9.12.2

small update: I also just noticed that trying to save a new item to my store now produces this error:

Method 'Some.Namespace.MyModel.Json' not found.

That 'Json' property is indeed a property that I added yesterday but deleted afterwards. So I'm really wondering why my model isn't updating...

#173412
Edited, Dec 23, 2016 9:41
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.