From 5175fb5188ba12719c73fb5c858558c4ccda7832 Mon Sep 17 00:00:00 2001 From: Morten Christensen Date: Tue, 19 Mar 2013 09:34:36 -0100 Subject: [PATCH] Updating the EntityService implementation --- src/Umbraco.Core/Services/EntityService.cs | 9 +++++++++ src/Umbraco.Core/Services/ServiceContext.cs | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/Umbraco.Core/Services/EntityService.cs b/src/Umbraco.Core/Services/EntityService.cs index 5d11898d97..a56d3a2f55 100644 --- a/src/Umbraco.Core/Services/EntityService.cs +++ b/src/Umbraco.Core/Services/EntityService.cs @@ -51,6 +51,7 @@ namespace Umbraco.Core.Services } } + //TODO Implementing loading from the various services throw new NotImplementedException(); } @@ -74,6 +75,7 @@ namespace Umbraco.Core.Services } } + //TODO Implementing loading from the various services throw new NotImplementedException(); } @@ -151,6 +153,8 @@ namespace Umbraco.Core.Services /// public virtual IEnumerable GetAll() where T : IUmbracoEntity { + //TODO Implement this so the type passed in is verified against types on UmbracoObjectTypes + //and then used to get all through the method below. throw new NotImplementedException(); } @@ -188,6 +192,7 @@ namespace Umbraco.Core.Services /// public virtual UmbracoObjectTypes GetObjectType(int id) { + //TODO Implement so the entity is fetched from the db and then the Guid is used to resolve the UmbracoObjectType throw new NotImplementedException(); } @@ -198,6 +203,8 @@ namespace Umbraco.Core.Services /// public virtual UmbracoObjectTypes GetObjectType(IUmbracoEntity entity) { + //TODO Implement this so the entity is cast to UmbracoEntity - if valid get the guid id and then resolve the UmbracoObjectType + //otherwise fetch the IUmbracoEntity from the db and do it similar to above. throw new NotImplementedException(); } @@ -208,6 +215,7 @@ namespace Umbraco.Core.Services /// public virtual Type GetModelType(int id) { + //TODO Implement so the IUmbracoEntity is fetched from the db and then used to resolve the real type, ie. IContent, IMedia etc. throw new NotImplementedException(); } @@ -218,6 +226,7 @@ namespace Umbraco.Core.Services /// public virtual Type GetModelType(UmbracoObjectTypes objectType) { + //TODO Implement so the real type is returned fro the UmbracoObjectType's attribute. throw new NotImplementedException(); } } diff --git a/src/Umbraco.Core/Services/ServiceContext.cs b/src/Umbraco.Core/Services/ServiceContext.cs index 7d7d877a86..9c53b989e0 100644 --- a/src/Umbraco.Core/Services/ServiceContext.cs +++ b/src/Umbraco.Core/Services/ServiceContext.cs @@ -21,6 +21,7 @@ namespace Umbraco.Core.Services private Lazy _fileService; private Lazy _localizationService; private Lazy _serverRegistrationService; + private Lazy _entityService; /// /// Constructor @@ -74,6 +75,9 @@ namespace Umbraco.Core.Services if(_localizationService == null) _localizationService = new Lazy(() => new LocalizationService(provider, repositoryFactory.Value)); + + if (_entityService == null) + _entityService = new Lazy(() => new EntityService(provider, repositoryFactory.Value)); } /// @@ -84,6 +88,14 @@ namespace Umbraco.Core.Services get { return _serverRegistrationService.Value; } } + /// + /// Gets the + /// + internal EntityService EntityService + { + get { return _entityService.Value; } + } + /// /// Gets the ///