Open ronaldbarendse opened 5 years ago
After merging with #223, the following XML documentation should be added to the GetModelContentType
method (above the ArgumentOutOfRangeException
):
/// <exception cref="InvalidOperationException">This method requires an UmbracoContext, ensure this is created using IUmbracoContextFactory.EnsureUmbracoContext().</exception>
This 'fixes' issue https://github.com/zpqrtbnk/Zbu.ModelsBuilder/issues/222 and should be able to get merged with PR https://github.com/zpqrtbnk/Zbu.ModelsBuilder/pull/223.
Instead of throwing an
ArgumentNullException
, this method now throws anInvalidOperationException
indicating it requires anUmbracoContext
to be present.To make it all work, callers should ensure this using
IUmbracoContextFactory.EnsureUmbracoContext()
as described in https://github.com/zpqrtbnk/Zbu.ModelsBuilder/issues/222#issuecomment-538320942.If you only need the property alias, the new
GetModelPropertyTypeAlias
method from PR https://github.com/zpqrtbnk/Zbu.ModelsBuilder/pull/223#issuecomment-538384680 doesn't require theUmbracoContext
.