While trying to get a property alias within Examines TransformingIndexValues event using Project.GetModelPropertyType(p => p.Products).Alias, I get an ArgumentNullException.
Looking at the source, this method requires an UmbracoContext that's not available while this event is fired. The fixme inject! comment probably says enough:
https://github.com/zpqrtbnk/Zbu.ModelsBuilder/blob/bf0da79aee8f52ec153bbb200131d1914ee95b2b/src/Umbraco.ModelsBuilder/Umbraco/PublishedModelUtility.cs#L27-L33
It should probably inject an IUmbracoContextAccessor somewhere and ensure the context exists, allow passing in a custom IPublishedSnapshot or at least return null instead of throwing this exception.
While trying to get a property alias within Examines
TransformingIndexValuesevent usingProject.GetModelPropertyType(p => p.Products).Alias, I get anArgumentNullException.Looking at the source, this method requires an
UmbracoContextthat's not available while this event is fired. Thefixme inject!comment probably says enough:https://github.com/zpqrtbnk/Zbu.ModelsBuilder/blob/bf0da79aee8f52ec153bbb200131d1914ee95b2b/src/Umbraco.ModelsBuilder/Umbraco/PublishedModelUtility.cs#L27-L33
It should probably inject an
IUmbracoContextAccessorsomewhere and ensure the context exists, allow passing in a customIPublishedSnapshotor at least returnnullinstead of throwing this exception.