Initial implementation of the EntityRepository and Service, which will be used to retrieve a basic object with a minimum set of propreties for the models that have their base in the umbracoNode table.
The intention is to use this for loading trees in the backoffice for faster loading.
This commit is contained in:
34
src/Umbraco.Core/CodeAnnotations/FriendlyNameAttribute.cs
Normal file
34
src/Umbraco.Core/CodeAnnotations/FriendlyNameAttribute.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.CodeAnnotations
|
||||
{
|
||||
/// <summary>
|
||||
/// Attribute to add a Friendly Name string with an UmbracoObjectType enum value
|
||||
/// </summary>
|
||||
internal class FriendlyNameAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// friendly name value
|
||||
/// </summary>
|
||||
private readonly string _friendlyName;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the FriendlyNameAttribute class
|
||||
/// Sets the friendly name value
|
||||
/// </summary>
|
||||
/// <param name="friendlyName">attribute value</param>
|
||||
public FriendlyNameAttribute(string friendlyName)
|
||||
{
|
||||
this._friendlyName = friendlyName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the friendly name
|
||||
/// </summary>
|
||||
/// <returns>string of friendly name</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return this._friendlyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace Umbraco.Core.CodeAnnotations
|
||||
{
|
||||
/// <summary>
|
||||
/// Attribute to associate a GUID string and Type with an UmbracoObjectType Enum value
|
||||
/// </summary>
|
||||
internal class UmbracoObjectTypeAttribute : Attribute
|
||||
{
|
||||
public UmbracoObjectTypeAttribute(string objectId)
|
||||
{
|
||||
ObjectId = new Guid(objectId);
|
||||
}
|
||||
|
||||
public UmbracoObjectTypeAttribute(string objectId, Type modelType)
|
||||
{
|
||||
ObjectId = new Guid(objectId);
|
||||
ModelType = modelType;
|
||||
}
|
||||
|
||||
public Guid ObjectId { get; private set; }
|
||||
|
||||
public Type ModelType { get; private set; }
|
||||
}
|
||||
}
|
||||
40
src/Umbraco.Core/Models/UmbracoEntity.cs
Normal file
40
src/Umbraco.Core/Models/UmbracoEntity.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Implementation of the <see cref="IUmbracoEntity"/> for internal use.
|
||||
/// </summary>
|
||||
internal class UmbracoEntity : Entity, IUmbracoEntity
|
||||
{
|
||||
public UmbracoEntity()
|
||||
{
|
||||
}
|
||||
|
||||
public UmbracoEntity(bool trashed)
|
||||
{
|
||||
Trashed = trashed;
|
||||
}
|
||||
|
||||
public int CreatorId { get; set; }
|
||||
|
||||
public int Level { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public int ParentId { get; set; }
|
||||
|
||||
public string Path { get; set; }
|
||||
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
public bool Trashed { get; private set; }
|
||||
|
||||
public bool HasChildren { get; set; }
|
||||
|
||||
public bool IsPublished { get; set; }
|
||||
|
||||
public Guid NodeObjectTypeId { get; set; }
|
||||
}
|
||||
}
|
||||
113
src/Umbraco.Core/Models/UmbracoObjectTypes.cs
Normal file
113
src/Umbraco.Core/Models/UmbracoObjectTypes.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
using Umbraco.Core.CodeAnnotations;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum used to represent the Umbraco Object Types and thier associated GUIDs
|
||||
/// </summary>
|
||||
public enum UmbracoObjectTypes
|
||||
{
|
||||
/// <summary>
|
||||
/// Default value
|
||||
/// </summary>
|
||||
Unknown,
|
||||
|
||||
/// <summary>
|
||||
/// Content Item Type
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.ContentItemType)]
|
||||
[FriendlyName("Content Item Type")]
|
||||
ContentItemType,
|
||||
|
||||
/// <summary>
|
||||
/// Root
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.SystemRoot)]
|
||||
[FriendlyName("Root")]
|
||||
ROOT,
|
||||
|
||||
/// <summary>
|
||||
/// Document
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.Document, typeof(IContent))]
|
||||
[FriendlyName("Document")]
|
||||
Document,
|
||||
|
||||
/// <summary>
|
||||
/// Media
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.Media, typeof(IMedia))]
|
||||
[FriendlyName("Media")]
|
||||
Media,
|
||||
|
||||
/// <summary>
|
||||
/// Member Type
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.MemberType)]
|
||||
[FriendlyName("Member Type")]
|
||||
MemberType,
|
||||
|
||||
/// <summary>
|
||||
/// Template
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.Template, typeof(ITemplate))]
|
||||
[FriendlyName("Template")]
|
||||
Template,
|
||||
|
||||
/// <summary>
|
||||
/// Member Group
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.MemberGroup)]
|
||||
[FriendlyName("Member Group")]
|
||||
MemberGroup,
|
||||
|
||||
/// <summary>
|
||||
/// Content Item
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.ContentItem)]
|
||||
[FriendlyName("Content Item")]
|
||||
ContentItem,
|
||||
|
||||
/// <summary>
|
||||
/// "Media Type
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.MediaType, typeof(IMediaType))]
|
||||
[FriendlyName("Media Type")]
|
||||
MediaType,
|
||||
|
||||
/// <summary>
|
||||
/// Document Type
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.DocumentType, typeof(IContentType))]
|
||||
[FriendlyName("Document Type")]
|
||||
DocumentType,
|
||||
|
||||
/// <summary>
|
||||
/// Recycle Bin
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.RecycleBin)]
|
||||
[FriendlyName("Recycle Bin")]
|
||||
RecycleBin,
|
||||
|
||||
/// <summary>
|
||||
/// Stylesheet
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.Stylesheet)]
|
||||
[FriendlyName("Stylesheet")]
|
||||
Stylesheet,
|
||||
|
||||
/// <summary>
|
||||
/// Member
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.Member)]
|
||||
[FriendlyName("Member")]
|
||||
Member,
|
||||
|
||||
/// <summary>
|
||||
/// Data Type
|
||||
/// </summary>
|
||||
[UmbracoObjectTypeAttribute(Constants.ObjectTypes.DataType, typeof(IDataTypeDefinition))]
|
||||
[FriendlyName("Data Type")]
|
||||
DataType
|
||||
}
|
||||
}
|
||||
79
src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs
Normal file
79
src/Umbraco.Core/Models/UmbracoObjectTypesExtensions.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using Umbraco.Core.CodeAnnotations;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Extension methods for the UmbracoObjectTypes enum
|
||||
/// </summary>
|
||||
public static class UmbracoObjectTypesExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Get an UmbracoObjectTypes value from it's name
|
||||
/// </summary>
|
||||
/// <param name="name">Enum value name</param>
|
||||
/// <returns>an UmbracoObjectTypes Enum value</returns>
|
||||
public static UmbracoObjectTypes GetUmbracoObjectType(string name)
|
||||
{
|
||||
return (UmbracoObjectTypes)Enum.Parse(typeof(UmbracoObjectTypes), name, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get an instance of an UmbracoObjectTypes enum value from it's GUID
|
||||
/// </summary>
|
||||
/// <param name="guid">Enum value GUID</param>
|
||||
/// <returns>an UmbracoObjectTypes Enum value</returns>
|
||||
public static UmbracoObjectTypes GetUmbracoObjectType(Guid guid)
|
||||
{
|
||||
var umbracoObjectType = UmbracoObjectTypes.Unknown;
|
||||
|
||||
foreach (var name in Enum.GetNames(typeof(UmbracoObjectTypes)))
|
||||
{
|
||||
if (GetUmbracoObjectType(name).GetGuid() == guid)
|
||||
{
|
||||
umbracoObjectType = GetUmbracoObjectType(name);
|
||||
}
|
||||
}
|
||||
|
||||
return umbracoObjectType;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension method for the UmbracoObjectTypes enum to return the enum GUID
|
||||
/// </summary>
|
||||
/// <param name="umbracoObjectType">UmbracoObjectTypes Enum value</param>
|
||||
/// <returns>a GUID value of the UmbracoObjectTypes</returns>
|
||||
public static Guid GetGuid(this UmbracoObjectTypes umbracoObjectType)
|
||||
{
|
||||
var attribute = umbracoObjectType.GetType().FirstAttribute<UmbracoObjectTypeAttribute>();
|
||||
if (attribute == null)
|
||||
return Guid.Empty;
|
||||
|
||||
return attribute.ObjectId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension method for the UmbracoObjectTypes enum to return the enum name
|
||||
/// </summary>
|
||||
/// <param name="umbracoObjectType">UmbracoObjectTypes value</param>
|
||||
/// <returns>The enum name of the UmbracoObjectTypes value</returns>
|
||||
public static string GetName(this UmbracoObjectTypes umbracoObjectType)
|
||||
{
|
||||
return Enum.GetName(typeof(UmbracoObjectTypes), umbracoObjectType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extension method for the UmbracoObejctTypes enum to return the enum friendly name
|
||||
/// </summary>
|
||||
/// <param name="umbracoObjectType">UmbracoObjectTypes value</param>
|
||||
/// <returns>a string of the FriendlyName</returns>
|
||||
public static string GetFriendlyName(this UmbracoObjectTypes umbracoObjectType)
|
||||
{
|
||||
var attribute = umbracoObjectType.GetType().FirstAttribute<FriendlyNameAttribute>();
|
||||
if (attribute == null)
|
||||
return string.Empty;
|
||||
|
||||
return attribute.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using System.Globalization;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Factories
|
||||
{
|
||||
internal class UmbracoEntityFactory : IEntityFactory<UmbracoEntity, NodeDto>
|
||||
{
|
||||
public UmbracoEntity BuildEntity(NodeDto dto)
|
||||
{
|
||||
var entity = new UmbracoEntity(dto.Trashed)
|
||||
{
|
||||
CreateDate = dto.CreateDate,
|
||||
CreatorId = dto.UserId.Value,
|
||||
Id = dto.NodeId,
|
||||
Key = dto.UniqueId.Value,
|
||||
Level = dto.Level,
|
||||
Name = dto.Text,
|
||||
NodeObjectTypeId = dto.NodeObjectType.Value,
|
||||
ParentId = dto.ParentId,
|
||||
Path = dto.Path,
|
||||
SortOrder = dto.SortOrder,
|
||||
HasChildren = false,
|
||||
IsPublished = false
|
||||
};
|
||||
return entity;
|
||||
}
|
||||
|
||||
public NodeDto BuildDto(UmbracoEntity entity)
|
||||
{
|
||||
var node = new NodeDto
|
||||
{
|
||||
CreateDate = entity.CreateDate,
|
||||
Level = short.Parse(entity.Level.ToString(CultureInfo.InvariantCulture)),
|
||||
NodeId = entity.Id,
|
||||
NodeObjectType = entity.NodeObjectTypeId,
|
||||
ParentId = entity.ParentId,
|
||||
Path = entity.Path,
|
||||
SortOrder = entity.SortOrder,
|
||||
Text = entity.Name,
|
||||
Trashed = entity.Trashed,
|
||||
UniqueId = entity.Key,
|
||||
UserId = entity.CreatorId
|
||||
};
|
||||
return node;
|
||||
}
|
||||
}
|
||||
}
|
||||
177
src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs
Normal file
177
src/Umbraco.Core/Persistence/Repositories/EntityRepository.cs
Normal file
@@ -0,0 +1,177 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
using Umbraco.Core.Persistence.Factories;
|
||||
using Umbraco.Core.Persistence.Querying;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Repositories
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the EntityRepository used to query <see cref="IUmbracoEntity"/> objects.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is limited to objects that are based in the umbracoNode-table.
|
||||
/// </remarks>
|
||||
internal class EntityRepository : DisposableObject, IEntityRepository
|
||||
{
|
||||
private readonly IDatabaseUnitOfWork _work;
|
||||
|
||||
public EntityRepository(IDatabaseUnitOfWork work)
|
||||
{
|
||||
_work = work;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Unit of Work added to the repository
|
||||
/// </summary>
|
||||
protected internal IDatabaseUnitOfWork UnitOfWork
|
||||
{
|
||||
get { return _work; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Internal for testing purposes
|
||||
/// </summary>
|
||||
internal Guid UnitKey
|
||||
{
|
||||
get { return (Guid)_work.Key; }
|
||||
}
|
||||
|
||||
#region Query Methods
|
||||
|
||||
public virtual IUmbracoEntity Get(int id)
|
||||
{
|
||||
var sql = GetBaseWhere(id);
|
||||
var nodeDto = _work.Database.FirstOrDefault<NodeDto>(sql);
|
||||
if (nodeDto == null)
|
||||
return null;
|
||||
|
||||
var factory = new UmbracoEntityFactory();
|
||||
var entity = factory.BuildEntity(nodeDto);
|
||||
|
||||
//TODO Update HasChildren and IsPublished
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public virtual IUmbracoEntity Get(int id, Guid objectTypeId)
|
||||
{
|
||||
var sql = GetBaseWhere(objectTypeId, id);
|
||||
var nodeDto = _work.Database.FirstOrDefault<NodeDto>(sql);
|
||||
if (nodeDto == null)
|
||||
return null;
|
||||
|
||||
var factory = new UmbracoEntityFactory();
|
||||
var entity = factory.BuildEntity(nodeDto);
|
||||
|
||||
//TODO Update HasChildren and IsPublished
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
public virtual IEnumerable<IUmbracoEntity> GetAll(Guid objectTypeId, params int[] ids)
|
||||
{
|
||||
if (ids.Any())
|
||||
{
|
||||
foreach (var id in ids)
|
||||
{
|
||||
yield return Get(id, objectTypeId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var sql = GetBaseWhere(objectTypeId);
|
||||
var dtos = _work.Database.Fetch<NodeDto>(sql);
|
||||
|
||||
var factory = new UmbracoEntityFactory();
|
||||
|
||||
foreach (var dto in dtos)
|
||||
{
|
||||
var entity = factory.BuildEntity(dto);
|
||||
//TODO Update HasChildren and IsPublished properties
|
||||
yield return entity;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public virtual IEnumerable<IUmbracoEntity> GetByQuery(IQuery<IUmbracoEntity> query)
|
||||
{
|
||||
var sqlClause = GetBaseQuery();
|
||||
var translator = new SqlTranslator<IUmbracoEntity>(sqlClause, query);
|
||||
var sql = translator.Translate();
|
||||
|
||||
var dtos = _work.Database.Fetch<NodeDto>(sql);
|
||||
|
||||
var factory = new UmbracoEntityFactory();
|
||||
var list = dtos.Select(factory.BuildEntity).Cast<IUmbracoEntity>().ToList();
|
||||
|
||||
//TODO Update HasChildren and IsPublished properties
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public virtual IEnumerable<IUmbracoEntity> GetByQuery(IQuery<IUmbracoEntity> query, Guid objectTypeId)
|
||||
{
|
||||
var sqlClause = GetBaseWhere(objectTypeId);
|
||||
var translator = new SqlTranslator<IUmbracoEntity>(sqlClause, query);
|
||||
var sql = translator.Translate();
|
||||
|
||||
var dtos = _work.Database.Fetch<NodeDto>(sql);
|
||||
|
||||
var factory = new UmbracoEntityFactory();
|
||||
var list = dtos.Select(factory.BuildEntity).Cast<IUmbracoEntity>().ToList();
|
||||
|
||||
//TODO Update HasChildren and IsPublished properties
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sql Statements
|
||||
|
||||
protected virtual Sql GetBaseQuery()
|
||||
{
|
||||
var sql = new Sql()
|
||||
.From<NodeDto>();
|
||||
return sql;
|
||||
}
|
||||
|
||||
protected virtual Sql GetBaseWhere(Guid id)
|
||||
{
|
||||
var sql = GetBaseQuery()
|
||||
.Where<NodeDto>(x => x.NodeObjectType == id);
|
||||
return sql;
|
||||
}
|
||||
|
||||
protected virtual Sql GetBaseWhere(int id)
|
||||
{
|
||||
var sql = GetBaseQuery()
|
||||
.Where<NodeDto>(x => x.NodeId == id);
|
||||
return sql;
|
||||
}
|
||||
|
||||
protected virtual Sql GetBaseWhere(Guid objectId, int id)
|
||||
{
|
||||
var sql = GetBaseWhere(objectId)
|
||||
.Where<NodeDto>(x => x.NodeId == id);
|
||||
return sql;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Dispose disposable properties
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Ensure the unit of work is disposed
|
||||
/// </remarks>
|
||||
protected override void DisposeResources()
|
||||
{
|
||||
UnitOfWork.DisposeIfDisposable();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
using Umbraco.Core.Persistence.Querying;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Repositories
|
||||
{
|
||||
public interface IEntityRepository : IRepository
|
||||
{
|
||||
IUmbracoEntity Get(int id);
|
||||
IUmbracoEntity Get(int id, Guid objectTypeId);
|
||||
IEnumerable<IUmbracoEntity> GetAll(Guid objectTypeId, params int[] ids);
|
||||
IEnumerable<IUmbracoEntity> GetByQuery(IQuery<IUmbracoEntity> query);
|
||||
IEnumerable<IUmbracoEntity> GetByQuery(IQuery<IUmbracoEntity> query, Guid objectTypeId);
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,11 @@ namespace Umbraco.Core.Persistence
|
||||
CreateUserTypeRepository(uow));
|
||||
}
|
||||
|
||||
internal virtual IEntityRepository CreateEntityRepository(IDatabaseUnitOfWork uow)
|
||||
{
|
||||
return new EntityRepository(uow);
|
||||
}
|
||||
|
||||
public virtual IContentRepository CreateContentRepository(IDatabaseUnitOfWork uow)
|
||||
{
|
||||
return new ContentRepository(
|
||||
|
||||
112
src/Umbraco.Core/Services/EntityService.cs
Normal file
112
src/Umbraco.Core/Services/EntityService.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
|
||||
namespace Umbraco.Core.Services
|
||||
{
|
||||
internal class EntityService : IService
|
||||
{
|
||||
private readonly IDatabaseUnitOfWorkProvider _uowProvider;
|
||||
private readonly RepositoryFactory _repositoryFactory;
|
||||
|
||||
public EntityService()
|
||||
: this(new RepositoryFactory())
|
||||
{ }
|
||||
|
||||
public EntityService(RepositoryFactory repositoryFactory)
|
||||
: this(new PetaPocoUnitOfWorkProvider(), repositoryFactory)
|
||||
{ }
|
||||
|
||||
public EntityService(IDatabaseUnitOfWorkProvider provider)
|
||||
: this(provider, new RepositoryFactory())
|
||||
{ }
|
||||
|
||||
public EntityService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory)
|
||||
{
|
||||
_uowProvider = provider;
|
||||
_repositoryFactory = repositoryFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an UmbracoEntity by its Id, and optionally loads the complete object graph.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// By default this will load the base type <see cref="IUmbracoEntity"/> with a minimum set of properties.
|
||||
/// </returns>
|
||||
/// <param name="id">Id of the object to retrieve</param>
|
||||
/// <param name="loadBaseType">Optional bool to load the complete object graph when set to <c>False</c>.</param>
|
||||
/// <returns>An <see cref="IUmbracoEntity"/></returns>
|
||||
public virtual IUmbracoEntity Get(int id, bool loadBaseType = true)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an UmbracoEntity by its Id and specified Type. Optionally loads the complete object graph.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// By default this will load the base type <see cref="IUmbracoEntity"/> with a minimum set of properties.
|
||||
/// </returns>
|
||||
/// <typeparam name="T">Type of the model to retrieve. Must be based on an <see cref="IUmbracoEntity"/></typeparam>
|
||||
/// <param name="id">Id of the object to retrieve</param>
|
||||
/// <param name="loadBaseType">Optional bool to load the complete object graph when set to <c>False</c>.</param>
|
||||
/// <returns>An <see cref="IUmbracoEntity"/></returns>
|
||||
public virtual IUmbracoEntity Get<T>(int id, bool loadBaseType = true) where T : IUmbracoEntity
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual IUmbracoEntity GetParent(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual IEnumerable<IUmbracoEntity> GetChildren(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual IEnumerable<IUmbracoEntity> GetDescendents(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual IEnumerable<IUmbracoEntity> GetAll<T>() where T : IUmbracoEntity
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual IEnumerable<IUmbracoEntity> GetAll(UmbracoObjectTypes objectType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual IEnumerable<IUmbracoEntity> GetAll(Guid objectTypeId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual UmbracoObjectTypes GetObjectType(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual UmbracoObjectTypes GetObjectType(IUmbracoEntity entity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual Type GetModelType(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public virtual Type GetModelType(UmbracoObjectTypes objectType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,6 +109,8 @@
|
||||
<Compile Include="Auditing\IAuditWriteProvider.cs" />
|
||||
<Compile Include="CacheHelper.cs" />
|
||||
<Compile Include="Cache\CacheKeys.cs" />
|
||||
<Compile Include="CodeAnnotations\FriendlyNameAttribute.cs" />
|
||||
<Compile Include="CodeAnnotations\UmbracoObjectTypeAttribute.cs" />
|
||||
<Compile Include="CodeAnnotations\UmbracoWillObsoleteAttribute.cs" />
|
||||
<Compile Include="CodeAnnotations\UmbracoExperimentalFeatureAttribute.cs" />
|
||||
<Compile Include="CodeAnnotations\UmbracoProposedPublicAttribute.cs" />
|
||||
@@ -206,6 +208,9 @@
|
||||
<Compile Include="Models\Task.cs" />
|
||||
<Compile Include="Models\TaskType.cs" />
|
||||
<Compile Include="Models\Template.cs" />
|
||||
<Compile Include="Models\UmbracoEntity.cs" />
|
||||
<Compile Include="Models\UmbracoObjectTypes.cs" />
|
||||
<Compile Include="Models\UmbracoObjectTypesExtensions.cs" />
|
||||
<Compile Include="ObjectResolution\ApplicationEventsResolver.cs" />
|
||||
<Compile Include="ObjectResolution\ResolverCollection.cs" />
|
||||
<Compile Include="Persistence\Caching\InMemoryCacheProvider.cs" />
|
||||
@@ -213,6 +218,7 @@
|
||||
<Compile Include="Persistence\Caching\NullCacheProvider.cs" />
|
||||
<Compile Include="Persistence\Caching\RuntimeCacheProvider.cs" />
|
||||
<Compile Include="Persistence\Factories\ServerRegistrationFactory.cs" />
|
||||
<Compile Include="Persistence\Factories\UmbracoEntityFactory.cs" />
|
||||
<Compile Include="Persistence\FaultHandling\ITransientErrorDetectionStrategy.cs" />
|
||||
<Compile Include="Persistence\FaultHandling\RetryingEventArgs.cs" />
|
||||
<Compile Include="Persistence\FaultHandling\RetryLimitExceededException.cs" />
|
||||
@@ -436,7 +442,9 @@
|
||||
<Compile Include="Persistence\Repositories\ContentTypeRepository.cs" />
|
||||
<Compile Include="Persistence\Repositories\DataTypeDefinitionRepository.cs" />
|
||||
<Compile Include="Persistence\Repositories\DictionaryRepository.cs" />
|
||||
<Compile Include="Persistence\Repositories\EntityRepository.cs" />
|
||||
<Compile Include="Persistence\Repositories\FileRepository.cs" />
|
||||
<Compile Include="Persistence\Repositories\Interfaces\IEntityRepository.cs" />
|
||||
<Compile Include="Persistence\Repositories\Interfaces\IContentRepository.cs" />
|
||||
<Compile Include="Persistence\Repositories\Interfaces\IContentTypeRepository.cs" />
|
||||
<Compile Include="Persistence\Repositories\Interfaces\IDataTypeDefinitionRepository.cs" />
|
||||
@@ -670,6 +678,7 @@
|
||||
<Compile Include="Services\ContentService.cs" />
|
||||
<Compile Include="Services\ContentTypeService.cs" />
|
||||
<Compile Include="Services\DataTypeService.cs" />
|
||||
<Compile Include="Services\EntityService.cs" />
|
||||
<Compile Include="Services\FileService.cs" />
|
||||
<Compile Include="Services\IContentService.cs" />
|
||||
<Compile Include="Services\IContentTypeService.cs" />
|
||||
|
||||
Reference in New Issue
Block a user