Skip to content

Conversation

ronaldbarendse
Copy link

This 'fixes' issue #222 and should be able to get merged with PR #223.

Instead of throwing an ArgumentNullException, this method now throws an InvalidOperationException indicating it requires an UmbracoContext to be present.

To make it all work, callers should ensure this using IUmbracoContextFactory.EnsureUmbracoContext() as described in #222 (comment).

If you only need the property alias, the new GetModelPropertyTypeAlias method from PR #223 (comment) doesn't require the UmbracoContext.

@ronaldbarendse
Copy link
Author

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant