Refactor - IPublishedContent, converters, fragments (cont)

This commit is contained in:
Stephan
2016-06-29 15:28:40 +02:00
parent 12e5372148
commit a8bb18ecae
26 changed files with 665 additions and 717 deletions

View File

@@ -26,18 +26,6 @@ namespace Umbraco.Core.Models.PublishedContent
var model = PublishedContentModelFactoryResolver.Current.Factory.CreateModel(content);
if (model == null)
throw new Exception("IPublishedContentFactory returned null.");
if (ReferenceEquals(model, content))
return content;
// at the moment, other parts of our code assume that all models will
// somehow implement IPublishedContentExtended and not just be IPublishedContent,
// so we'd better check this here to fail as soon as we can.
//
// see also PublishedContentExtended.Extend
var extended = model as IPublishedContentExtended;
if (extended == null)
throw new Exception("IPublishedContentFactory created an object that does not implement IPublishedContentModelExtended.");
return model;
}