Web.Mvc - Refactor UmbracoViewPage, UmbracoTemplatePage, support strongly-typed content
Conflicts: src/Umbraco.Web/Umbraco.Web.csproj
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace Umbraco.Web.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the model for the current rendering page in Umbraco
|
||||
/// </summary>
|
||||
public class RenderModel
|
||||
public class RenderModel : IRenderModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor specifying both the IPublishedContent and the CultureInfo
|
||||
@@ -16,7 +17,7 @@ namespace Umbraco.Web.Models
|
||||
/// <param name="culture"></param>
|
||||
public RenderModel(IPublishedContent content, CultureInfo culture)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException("content");
|
||||
if (content == null) throw new ArgumentNullException("content");
|
||||
if (culture == null) throw new ArgumentNullException("culture");
|
||||
Content = content;
|
||||
CurrentCulture = culture;
|
||||
@@ -28,7 +29,7 @@ namespace Umbraco.Web.Models
|
||||
/// <param name="content"></param>
|
||||
public RenderModel(IPublishedContent content)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException("content");
|
||||
if (content == null) throw new ArgumentNullException("content");
|
||||
if (UmbracoContext.Current == null)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot construct a RenderModel without specifying a CultureInfo when no UmbracoContext has been initialized");
|
||||
|
||||
Reference in New Issue
Block a user