From 29c22cc4b5026177ffeba0a17b28c899563c33bb Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 16 Dec 2013 19:02:53 +1100 Subject: [PATCH] exposes repository service --- src/Umbraco.Core/Services/ServiceContext.cs | 26 ++++++++++----------- src/Umbraco.Tests/MockTests.cs | 8 +++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Core/Services/ServiceContext.cs b/src/Umbraco.Core/Services/ServiceContext.cs index 725697fa26..28fbd9fffb 100644 --- a/src/Umbraco.Core/Services/ServiceContext.cs +++ b/src/Umbraco.Core/Services/ServiceContext.cs @@ -23,7 +23,7 @@ namespace Umbraco.Core.Services private Lazy _packagingService; private Lazy _serverRegistrationService; private Lazy _entityService; - //private Lazy _relationService; + private Lazy _relationService; //private Lazy _treeService; //private Lazy _sectionService; //private Lazy _macroService; @@ -52,8 +52,8 @@ namespace Umbraco.Core.Services IFileService fileService, ILocalizationService localizationService, PackagingService packagingService, - IEntityService entityService/*, - IRelationService relationService, + IEntityService entityService, + IRelationService relationService/*, ISectionService sectionService, IApplicationTreeService treeService*/) { @@ -65,7 +65,7 @@ namespace Umbraco.Core.Services _localizationService = new Lazy(() => localizationService); _packagingService = new Lazy(() => packagingService); _entityService = new Lazy(() => entityService); - //_relationService = new Lazy(() => relationService); + _relationService = new Lazy(() => relationService); //_sectionService = new Lazy(() => sectionService); //_treeService = new Lazy(() => treeService); } @@ -131,8 +131,8 @@ namespace Umbraco.Core.Services if (_entityService == null) _entityService = new Lazy(() => new EntityService(provider, repositoryFactory.Value, _contentService.Value, _contentTypeService.Value, _mediaService.Value, _dataTypeService.Value)); - //if (_relationService == null) - // _relationService = new Lazy(() => new RelationService(provider, repositoryFactory.Value, _entityService.Value)); + if (_relationService == null) + _relationService = new Lazy(() => new RelationService(provider, repositoryFactory.Value, _entityService.Value)); //if (_treeService == null) // _treeService = new Lazy(() => new ApplicationTreeService(cache)); @@ -172,13 +172,13 @@ namespace Umbraco.Core.Services get { return _entityService.Value; } } - ///// - ///// Gets the - ///// - //public IRelationService RelationService - //{ - // get { return _relationService.Value; } - //} + /// + /// Gets the + /// + public IRelationService RelationService + { + get { return _relationService.Value; } + } /// /// Gets the diff --git a/src/Umbraco.Tests/MockTests.cs b/src/Umbraco.Tests/MockTests.cs index 126fad79d8..ce049b9679 100644 --- a/src/Umbraco.Tests/MockTests.cs +++ b/src/Umbraco.Tests/MockTests.cs @@ -43,11 +43,11 @@ namespace Umbraco.Tests new Mock().Object, new RepositoryFactory(true), new Mock().Object), - new Mock().Object/*, + new Mock().Object, new RelationService( new Mock().Object, new RepositoryFactory(true), - new Mock().Object), + new Mock().Object)/*, new Mock().Object, new Mock().Object*/); Assert.Pass(); @@ -81,11 +81,11 @@ namespace Umbraco.Tests new Mock().Object, new RepositoryFactory(true), new Mock().Object), - new Mock().Object/*, + new Mock().Object, new RelationService( new Mock().Object, new RepositoryFactory(true), - new Mock().Object)*/), + new Mock().Object)), CacheHelper.CreateDisabledCacheHelper()); Assert.Pass(); }