2017-07-20 11:21:28 +02:00
|
|
|
|
using System;
|
2016-06-30 19:06:44 +02:00
|
|
|
|
using Umbraco.Core.Models.PublishedContent;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.Models
|
|
|
|
|
|
{
|
2017-07-20 11:21:28 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Represents the model for the current Umbraco view.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class ContentModel : IContentModel
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Initializes a new instance of the <see cref="ContentModel"/> class with a content.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="content"></param>
|
|
|
|
|
|
public ContentModel(IPublishedContent content)
|
|
|
|
|
|
{
|
2016-06-30 19:06:44 +02:00
|
|
|
|
if (content == null) throw new ArgumentNullException(nameof(content));
|
2017-07-20 11:21:28 +02:00
|
|
|
|
Content = content;
|
|
|
|
|
|
}
|
2016-06-30 19:06:44 +02:00
|
|
|
|
|
2017-07-20 11:21:28 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Gets the content.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public IPublishedContent Content { get; }
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|