Cleanup
This commit is contained in:
@@ -71,7 +71,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
throw new InvalidOperationException($"Both types {type.FullName} and {modelInfo.ModelType.FullName} want to be a model type for content type with alias \"{typeName}\".");
|
||||
|
||||
// have to use an unsafe ctor because we don't know the types, really
|
||||
var modelCtor = ReflectionUtilities.EmitCtorUnsafe<Func<object, object>>(constructor);
|
||||
var modelCtor = ReflectionUtilities.EmitConstructorUnsafe<Func<object, object>>(constructor);
|
||||
modelInfos[typeName] = new ModelInfo { ParameterType = parameterType, ModelType = type, Ctor = modelCtor };
|
||||
modelTypeMap[typeName] = type;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
if (ctor != null) return ctor();
|
||||
|
||||
var listType = typeof(List<>).MakeGenericType(modelInfo.ModelType);
|
||||
ctor = modelInfo.ListCtor = ReflectionUtilities.EmitCtor<Func<IList>>(declaring: listType);
|
||||
ctor = modelInfo.ListCtor = ReflectionUtilities.EmitConstuctor<Func<IList>>(declaring: listType);
|
||||
return ctor();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user