We have two media types (GenericMedia & Publication) which inherit media data and have a MediaDescriptor to associate the pdf,doc,docx extensions to both. When a user uploads a file via the asset manager its defaulting to publication but I want it to default to generic media
Ive used this blog post as the basis and would appear to do what I want but in my solution base.GetFirstMatching returns null. Any ideas why?
Snippet
[ServiceConfiguration(typeof(ContentMediaResolver)) ] public class DefaultContentMediaResolver : ContentMediaResolver { /// <summary> /// see http://getadigital.com/no/blogg/resolve-default-media-types-in-episerver/ /// </summary> public override Type GetFirstMatching(string extension) { var selectedAsDefault = base.GetFirstMatching(extension); //always null?
// For all types inheriting MediaData, I want to use class GenericMedia as default not publication if (typeof(MediaData).IsAssignableFrom(selectedAsDefault)) return typeof(GenericMedia);