View Source
Class ContentExtensions
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
public static class ContentExtensions
Methods
View Source
GetCreatorProfile(IContentBase)
Declaration
[Obsolete("Use the overload that declares the IUserService to use")]
public static IProfile GetCreatorProfile(this IContentBase content)
Parameters
Returns
View Source
GetCreatorProfile(IContentBase, IUserService)
Gets the IProfile for the Creator of this content item.
Declaration
public static IProfile GetCreatorProfile(this IContentBase content, IUserService userService)
Parameters
Returns
View Source
GetCreatorProfile(IMedia, IUserService)
Gets the IProfile for the Creator of this media item.
Declaration
public static IProfile GetCreatorProfile(this IMedia media, IUserService userService)
Parameters
Returns
View Source
GetDirtyUserProperties(IContentBase)
Declaration
public static IEnumerable<string> GetDirtyUserProperties(this IContentBase entity)
Parameters
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<System.String> |
|
View Source
GetNonGroupedProperties(IContentBase)
Returns properties that do not belong to a group
Declaration
public static IEnumerable<Property> GetNonGroupedProperties(this IContentBase content)
Parameters
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Property> |
|
View Source
GetPropertiesByEditor(IContentBase, String)
Returns all properties based on the editorAlias
Declaration
public static IEnumerable<Property> GetPropertiesByEditor(this IContentBase content, string editorAlias)
Parameters
Type |
Name |
Description |
IContentBase |
content |
|
System.String |
editorAlias |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Property> |
|
View Source
GetPropertiesForGroup(IContentBase, PropertyGroup)
Returns the Property object for the given property group
Declaration
public static IEnumerable<Property> GetPropertiesForGroup(this IContentBase content, PropertyGroup propertyGroup)
Parameters
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<Property> |
|
View Source
GetStatus(IContent, String)
Gets the current status of the Content
Declaration
public static ContentStatus GetStatus(this IContent content, string culture = null)
Parameters
Type |
Name |
Description |
IContent |
content |
|
System.String |
culture |
|
Returns
View Source
GetWriterProfile(IContent)
Declaration
[Obsolete("Use the overload that declares the IUserService to use")]
public static IProfile GetWriterProfile(this IContent content)
Parameters
Returns
View Source
GetWriterProfile(IContent, IUserService)
Gets the IProfile for the Writer of this content.
Declaration
public static IProfile GetWriterProfile(this IContent content, IUserService userService)
Parameters
Returns
View Source
GetWriterProfile(IMedia, IUserService)
Gets the IProfile for the Writer of this content.
Declaration
public static IProfile GetWriterProfile(this IMedia content, IUserService userService)
Parameters
Returns
View Source
IsAnyUserPropertyDirty(IContentBase)
Declaration
public static bool IsAnyUserPropertyDirty(this IContentBase entity)
Parameters
Returns
Type |
Description |
System.Boolean |
|
View Source
SanitizeEntityPropertiesForXmlStorage(IContentBase)
Declaration
public static void SanitizeEntityPropertiesForXmlStorage(this IContentBase entity)
Parameters
View Source
SetValue(IContentBase, IContentTypeBaseServiceProvider, String, String, Stream, String, String)
Sets the posted file value of a property.
Declaration
public static void SetValue(this IContentBase content, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, string propertyTypeAlias, string filename, Stream filestream, string culture = null, string segment = null)
Parameters
Type |
Name |
Description |
IContentBase |
content |
|
IContentTypeBaseServiceProvider |
contentTypeBaseServiceProvider |
|
System.String |
propertyTypeAlias |
|
System.String |
filename |
|
System.IO.Stream |
filestream |
|
System.String |
culture |
|
System.String |
segment |
|
View Source
SetValue(IContentBase, IContentTypeBaseServiceProvider, String, String, HttpPostedFileBase, String, String)
Sets the posted file value of a property.
Declaration
public static void SetValue(this IContentBase content, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, string propertyTypeAlias, string filename, HttpPostedFileBase postedFile, string culture = null, string segment = null)
Parameters
Type |
Name |
Description |
IContentBase |
content |
|
IContentTypeBaseServiceProvider |
contentTypeBaseServiceProvider |
|
System.String |
propertyTypeAlias |
|
System.String |
filename |
|
System.Web.HttpPostedFileBase |
postedFile |
|
System.String |
culture |
|
System.String |
segment |
|
View Source
StoreFile(IContentBase, IContentTypeBaseServiceProvider, String, String, Stream, String)
Declaration
public static string StoreFile(this IContentBase content, IContentTypeBaseServiceProvider contentTypeBaseServiceProvider, string propertyTypeAlias, string filename, Stream filestream, string filepath)
Parameters
Type |
Name |
Description |
IContentBase |
content |
IContentBaseA content item.
|
IContentTypeBaseServiceProvider |
contentTypeBaseServiceProvider |
|
System.String |
propertyTypeAlias |
The property alias.
|
System.String |
filename |
The name of the file.
|
System.IO.Stream |
filestream |
A stream containing the file data.
|
System.String |
filepath |
The original file path, if any.
|
Returns
Type |
Description |
System.String |
The path to the file, relative to the media filesystem.
|
View Source
ToXml(IContent, IEntityXmlSerializer)
Creates the xml representation for the IContent object
Declaration
public static XElement ToXml(this IContent content, IEntityXmlSerializer serializer)
Parameters
Returns
Type |
Description |
System.Xml.Linq.XElement |
Xml representation of the passed in IContent
|
View Source
ToXml(IMedia, IEntityXmlSerializer)
Creates the xml representation for the IMedia object
Declaration
public static XElement ToXml(this IMedia media, IEntityXmlSerializer serializer)
Parameters
Returns
Type |
Description |
System.Xml.Linq.XElement |
Xml representation of the passed in IContent
|
View Source
ToXml(IMember, IEntityXmlSerializer)
Creates the xml representation for the IMember object
Declaration
public static XElement ToXml(this IMember member, IEntityXmlSerializer serializer)
Parameters
Returns
Type |
Description |
System.Xml.Linq.XElement |
Xml representation of the passed in IContent
|
View Source
WasAnyUserPropertyDirty(IContentBase)
Declaration
public static bool WasAnyUserPropertyDirty(this IContentBase entity)
Parameters
Returns
Type |
Description |
System.Boolean |
|