U4-4847 Refactor ContentService (#1266)

* U4-4748 - refactor Content-, Media- and MemberTypeRepository

* Cleanup Attempt

* Cleanup OperationStatus

* U4-4748 - refactor Content-, Media- and MemberTypeService

* U4-4748 - cleanup locking

* U4-4748 - refactor Content-, Media- and MemberRepository

* U4-4748 - refactor ContentService (in progress)

* U4-4748 - all unit of work must be completed

* U4-4748 - refactor locks, fix tests

* U4-4748 - deal with fixmes

* U4-4748 - lock table migration

* Update UmbracoVersion

* Fix AuthorizeUpgrade

* U4-4748 - cleanup+bugfix lock objects

* U4-4748 - bugfix

* updates a string interpolation
This commit is contained in:
Stephan
2016-05-18 10:55:19 +02:00
committed by Shannon Deminick
parent 12f4873c90
commit ddf38407d8
139 changed files with 7539 additions and 6981 deletions

View File

@@ -219,7 +219,7 @@ namespace Umbraco.Web.Models.Mapping
if (HttpContext.Current != null && UmbracoContext.Current != null && UmbracoContext.Current.Security.CurrentUser != null
&& UmbracoContext.Current.Security.CurrentUser.AllowedSections.Any(x => x.Equals(Constants.Applications.Settings)))
{
var currentDocumentType = contentTypeService.GetContentType(display.ContentTypeAlias);
var currentDocumentType = contentTypeService.Get(display.ContentTypeAlias);
var currentDocumentTypeName = currentDocumentType == null ? string.Empty : currentDocumentType.Name;
var currentDocumentTypeId = currentDocumentType == null ? string.Empty : currentDocumentType.Id.ToString(CultureInfo.InvariantCulture);

View File

@@ -69,7 +69,7 @@ namespace Umbraco.Web.Models.Mapping
foreach (var a in add)
{
//TODO: Remove N+1 lookup
var addCt = applicationContext.Services.ContentTypeService.GetContentType(a);
var addCt = applicationContext.Services.ContentTypeService.Get(a);
if (addCt != null)
dest.AddContentType(addCt);
}
@@ -96,7 +96,7 @@ namespace Umbraco.Web.Models.Mapping
foreach (var a in add)
{
//TODO: Remove N+1 lookup
var addCt = applicationContext.Services.ContentTypeService.GetMediaType(a);
var addCt = applicationContext.Services.MediaTypeService.Get(a);
if (addCt != null)
dest.AddContentType(addCt);
}

View File

@@ -21,12 +21,12 @@ namespace Umbraco.Web.Models.Mapping
// get ancestor ids from path of parent if not root
if (source.ParentId != Constants.System.Root)
{
var parent = _applicationContext.Services.ContentTypeService.GetContentType(source.ParentId);
var parent = _applicationContext.Services.ContentTypeService.Get(source.ParentId);
if (parent != null)
{
var ancestorIds = parent.Path.Split(',').Select(int.Parse);
// loop through all content types and return ordered aliases of ancestors
var allContentTypes = _applicationContext.Services.ContentTypeService.GetAllContentTypes().ToArray();
var allContentTypes = _applicationContext.Services.ContentTypeService.GetAll().ToArray();
foreach (var ancestorId in ancestorIds)
{
var ancestor = allContentTypes.FirstOrDefault(x => x.Id == ancestorId);