Initialize collection in interceptor
I'm trying out something like this
public class DefaultInterceptor : EmptyInterceptor {
public override bool OnLoad(object entity, object id, object[] state, string[] propertyNames, IType[] types) {
var details = ((ContentItem) entity).Details;
var properties = entity.GetType().GetProperties();
foreach (PropertyInfo propertyInfo in properties) {
if(details.ContainsKey(propertyInfo.Name)) {
propertyInfo.SetValue(entity,details[propertyInfo.Name].Value,null);
}
}
return base.OnLoad(entity, id, state, propertyNames, types);
}
}
but my details collection is always empty here, is there any way of initialize this collection so i can do operations on it?