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:
what can be causing the NullReferenceException?
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?
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...
I'm working on a Dynamic Datastore plugin and got a NullReferenceException today when trying to load the store using the type:
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:
Using this overload my plugin loads just fine....
So now I'm wondering:
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?
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...