You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
there is a method N2.Definitions.Static.DefinitionBuilder.AddContainable which performs the following type check:
Type editableType = EnsureType<IEditable>(editable.Type);
before doing anything.
The thing that it may be called for the Editabled and Containers as well. Please see N2.Definitions.Static.DefinitionBuilder.UpdateDefinitionFromConfiguration method.
And in case of Containers, exception will be thrown since Container is not IEditable.
Seems to be that its better to check for IContainable rather than for IEditable: Type editableType = EnsureType<IContainable>(editable.Type);
since casting from IEditable to IContainable is possible, or perform different type check per each case.
N2CMS 2.2.1
The text was updated successfully, but these errors were encountered:
Hi,
there is a method N2.Definitions.Static.DefinitionBuilder.AddContainable which performs the following type check:
before doing anything.
The thing that it may be called for the Editabled and Containers as well. Please see
N2.Definitions.Static.DefinitionBuilder.UpdateDefinitionFromConfiguration
method.And in case of Containers, exception will be thrown since Container is not
IEditable
.Seems to be that its better to check for
IContainable
rather than forIEditable
: TypeeditableType = EnsureType<IContainable>(editable.Type);
since casting from IEditable to IContainable is possible, or perform different type check per each case.
N2CMS 2.2.1
The text was updated successfully, but these errors were encountered: