Files
Umbraco-CMS/src/Umbraco.Core/Models/IContentBase.cs
Stephan ddf38407d8 U4-4847 Refactor ContentService (#1266)
* U4-4748 - refactor Content-, Media- and MemberTypeRepository

* Cleanup Attempt

* Cleanup OperationStatus

* U4-4748 - refactor Content-, Media- and MemberTypeService

* U4-4748 - cleanup locking

* U4-4748 - refactor Content-, Media- and MemberRepository

* U4-4748 - refactor ContentService (in progress)

* U4-4748 - all unit of work must be completed

* U4-4748 - refactor locks, fix tests

* U4-4748 - deal with fixmes

* U4-4748 - lock table migration

* Update UmbracoVersion

* Fix AuthorizeUpgrade

* U4-4748 - cleanup+bugfix lock objects

* U4-4748 - bugfix

* updates a string interpolation
2016-05-18 10:55:19 +02:00

76 lines
3.0 KiB
C#

using System;
using System.Collections.Generic;
using Umbraco.Core.Models.EntityBase;
namespace Umbraco.Core.Models
{
/// <summary>
/// Defines the base for a Content object with properties that
/// are shared between Content and Media.
/// </summary>
public interface IContentBase : IUmbracoEntity
{
/// <summary>
/// Integer Id of the default ContentType
/// </summary>
int ContentTypeId { get; }
/// <summary>
/// Gets the Guid Id of the Content's Version
/// </summary>
Guid Version { get; }
/// <summary>
/// List of properties, which make up all the data available for this Content object
/// </summary>
/// <remarks>Properties are loaded as part of the Content object graph</remarks>
PropertyCollection Properties { get; set; }
/// <summary>
/// List of PropertyGroups available on this Content object
/// </summary>
/// <remarks>PropertyGroups are kind of lazy loaded as part of the object graph</remarks>
IEnumerable<PropertyGroup> PropertyGroups { get; }
/// <summary>
/// List of PropertyTypes available on this Content object
/// </summary>
/// <remarks>PropertyTypes are kind of lazy loaded as part of the object graph</remarks>
IEnumerable<PropertyType> PropertyTypes { get; }
/// <summary>
/// Indicates whether the content object has a property with the supplied alias
/// </summary>
/// <param name="propertyTypeAlias">Alias of the PropertyType</param>
/// <returns>True if Property with given alias exists, otherwise False</returns>
bool HasProperty(string propertyTypeAlias);
/// <summary>
/// Gets the value of a Property
/// </summary>
/// <param name="propertyTypeAlias">Alias of the PropertyType</param>
/// <returns><see cref="Property"/> Value as an <see cref="object"/></returns>
object GetValue(string propertyTypeAlias);
/// <summary>
/// Gets the value of a Property
/// </summary>
/// <typeparam name="TPassType">Type of the value to return</typeparam>
/// <param name="propertyTypeAlias">Alias of the PropertyType</param>
/// <returns><see cref="Property"/> Value as a <see cref="TPassType"/></returns>
TPassType GetValue<TPassType>(string propertyTypeAlias);
/// <summary>
/// Sets the <see cref="System.Object"/> value of a Property
/// </summary>
/// <param name="propertyTypeAlias">Alias of the PropertyType</param>
/// <param name="value">Value to set for the Property</param>
void SetValue(string propertyTypeAlias, object value);
/// <summary>
/// Boolean indicating whether the content and its properties are valid
/// </summary>
/// <returns>True if content is valid otherwise false</returns>
bool IsValid();
}
}