public object ConvertToModel(IPublishedContent content, CodeFirstModelContext parentContext = null)
        {
            ContentTypeRegistration docType;

            if (_contentTypeModule.TryGetContentType(content.DocumentTypeAlias, out docType))
            {
                MethodInfo convertToModel = GetConvertToModelMethod(docType.ClrType);
                return(convertToModel.Invoke(this, new object[] { content, parentContext }));
            }
            else
            {
                return(null);
            }
        }
Example #2
0
 private void RegisterEvents <Tevent>(Type type, Dictionary <string, ContentTypeRegistration> register)
 {
     if (ModelEventDispatcher.HasEvent <Tevent>(type))
     {
         ContentTypeRegistration reg;
         if (_contentTypeModuleBase.TryGetContentType(type, out reg))
         {
             register.Add(reg.Alias, reg);
         }
     }
 }