Creating IContentTypeService interface as the foundation for U4-937
This commit is contained in:
119
src/Umbraco.Web/Services/IContentTypeService.cs
Normal file
119
src/Umbraco.Web/Services/IContentTypeService.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Web.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the ContentTypeService, which is an easy access to operations involving <see cref="IContentType"/>
|
||||
/// </summary>
|
||||
public interface IContentTypeService
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IContentType"/> object by its Id
|
||||
/// </summary>
|
||||
/// <param name="id">Id of the <see cref="IContentType"/> to retrieve</param>
|
||||
/// <returns><see cref="IContentType"/></returns>
|
||||
IContentType GetContentType(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IContentType"/> object by its Alias
|
||||
/// </summary>
|
||||
/// <param name="alias">Alias of the <see cref="IContentType"/> to retrieve</param>
|
||||
/// <returns><see cref="IContentType"/></returns>
|
||||
IContentType GetContentType(string alias);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of all available <see cref="IContentType"/> objects
|
||||
/// </summary>
|
||||
/// <param name="ids">Optional list of ids</param>
|
||||
/// <returns>An Enumerable list of <see cref="IContentType"/> objects</returns>
|
||||
IEnumerable<IContentType> GetAllContentTypes(params int[] ids);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of children for a <see cref="IContentType"/> object
|
||||
/// </summary>
|
||||
/// <param name="id">Id of the Parent</param>
|
||||
/// <returns>An Enumerable list of <see cref="IContentType"/> objects</returns>
|
||||
IEnumerable<IContentType> GetContentTypeChildren(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a single <see cref="IContentType"/> object
|
||||
/// </summary>
|
||||
/// <param name="contentType"><see cref="IContentType"/> to save</param>
|
||||
void Save(IContentType contentType);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a collection of <see cref="IContentType"/> objects
|
||||
/// </summary>
|
||||
/// <param name="contentTypes">Collection of <see cref="IContentType"/> to save</param>
|
||||
void Save(IEnumerable<IContentType> contentTypes);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a single <see cref="IContentType"/> object
|
||||
/// </summary>
|
||||
/// <param name="contentType"><see cref="IContentType"/> to delete</param>
|
||||
/// <remarks>Deleting a <see cref="IContentType"/> will delete all the <see cref="IContent"/> objects based on this <see cref="IContentType"/></remarks>
|
||||
void Delete(IContentType contentType);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a collection of <see cref="IContentType"/> objects
|
||||
/// </summary>
|
||||
/// <param name="contentTypes">Collection of <see cref="IContentType"/> to delete</param>
|
||||
/// <remarks>Deleting a <see cref="IContentType"/> will delete all the <see cref="IContent"/> objects based on this <see cref="IContentType"/></remarks>
|
||||
void Delete(IEnumerable<IContentType> contentTypes);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMediaType"/> object by its Id
|
||||
/// </summary>
|
||||
/// <param name="id">Id of the <see cref="IMediaType"/> to retrieve</param>
|
||||
/// <returns><see cref="IMediaType"/></returns>
|
||||
IMediaType GetMediaType(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMediaType"/> object by its Alias
|
||||
/// </summary>
|
||||
/// <param name="alias">Alias of the <see cref="IMediaType"/> to retrieve</param>
|
||||
/// <returns><see cref="IMediaType"/></returns>
|
||||
IMediaType GetMediaType(string alias);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of all available <see cref="IMediaType"/> objects
|
||||
/// </summary>
|
||||
/// <param name="ids">Optional list of ids</param>
|
||||
/// <returns>An Enumerable list of <see cref="IMediaType"/> objects</returns>
|
||||
IEnumerable<IMediaType> GetAllMediaTypes(params int[] ids);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of children for a <see cref="IMediaType"/> object
|
||||
/// </summary>
|
||||
/// <param name="id">Id of the Parent</param>
|
||||
/// <returns>An Enumerable list of <see cref="IMediaType"/> objects</returns>
|
||||
IEnumerable<IMediaType> GetMediaTypeChildren(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a single <see cref="IMediaType"/> object
|
||||
/// </summary>
|
||||
/// <param name="mediaType"><see cref="IMediaType"/> to save</param>
|
||||
void Save(IMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a collection of <see cref="IMediaType"/> objects
|
||||
/// </summary>
|
||||
/// <param name="mediaTypes">Collection of <see cref="IMediaType"/> to save</param>
|
||||
void Save(IEnumerable<IMediaType> mediaTypes);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a single <see cref="IMediaType"/> object
|
||||
/// </summary>
|
||||
/// <param name="mediaType"><see cref="IMediaType"/> to delete</param>
|
||||
/// <remarks>Deleting a <see cref="IMediaType"/> will delete all the <see cref="IMedia"/> objects based on this <see cref="IMediaType"/></remarks>
|
||||
void Delete(IMediaType mediaType);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a collection of <see cref="IMediaType"/> objects
|
||||
/// </summary>
|
||||
/// <param name="mediaTypes">Collection of <see cref="IMediaType"/> to delete</param>
|
||||
/// <remarks>Deleting a <see cref="IMediaType"/> will delete all the <see cref="IMedia"/> objects based on this <see cref="IMediaType"/></remarks>
|
||||
void Delete(IEnumerable<IMediaType> mediaTypes);
|
||||
}
|
||||
}
|
||||
@@ -315,6 +315,7 @@
|
||||
<Compile Include="Mvc\SurfaceControllerResolver.cs" />
|
||||
<Compile Include="Services\ContentService.cs" />
|
||||
<Compile Include="Services\IContentService.cs" />
|
||||
<Compile Include="Services\IContentTypeService.cs" />
|
||||
<Compile Include="Templates\TemplateUtilities.cs" />
|
||||
<Compile Include="umbraco.presentation\Default.aspx.cs">
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
Reference in New Issue
Block a user