Hidden caveat in Episerver DDS GenerateTypeBag()

lockevn
1 min readMar 1, 2017

--

See this code

var pb = new PropertyBag();

pb.Add(“c1”, “string1”);

pb.Add(“c2”, null);

pb.Add(“c3”, 19);

var typebag = pb.GenerateTypeBag();

typebag only has 2 Types which is string and int. Column c2 is ignored.

For example, you have store with c1, c2, c3.
That store has a few records, with values in c1, c2, c3.

With this new record pb, be careful if you generate typebag from it, then sync change in your store (by calling storeDefinition.Remap()). You will lose column c2 for all records in that store.

--

--

lockevn
lockevn

Written by lockevn

Developer, Sportman. Write code with joy, bake app with heart. Opinions are my own. If you feel I save your time, go http://BuyMeACoff.ee/Lockevn

No responses yet