From b8ac74a05d3e0f6b13674585f846723aa595c83a Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 28 Jan 2013 09:02:28 -0100 Subject: [PATCH] fix merges --- src/Umbraco.Core/Models/ContentExtensions.cs | 21 +++++--------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/Umbraco.Core/Models/ContentExtensions.cs b/src/Umbraco.Core/Models/ContentExtensions.cs index 90a8e517a4..66eac0a830 100644 --- a/src/Umbraco.Core/Models/ContentExtensions.cs +++ b/src/Umbraco.Core/Models/ContentExtensions.cs @@ -303,23 +303,15 @@ namespace Umbraco.Core.Models /// public static IProfile GetCreatorProfile(this IMedia media) { - using (var repository = RepositoryResolver.Current.Factory.CreateUserRepository( - PetaPocoUnitOfWorkProvider.CreateUnitOfWork())) - { - return repository.GetProfileById(media.CreatorId); - } - } + return ApplicationContext.Current.Services.UserService.GetProfileById(media.CreatorId); + } /// /// Gets the for the Creator of this content item. /// public static IProfile GetCreatorProfile(this IContentBase content) { - using (var repository = RepositoryResolver.Current.Factory.CreateUserRepository( - PetaPocoUnitOfWorkProvider.CreateUnitOfWork())) - { - return repository.GetProfileById(content.CreatorId); - } + return ApplicationContext.Current.Services.UserService.GetProfileById(content.CreatorId); } /// @@ -327,11 +319,7 @@ namespace Umbraco.Core.Models /// public static IProfile GetWriterProfile(this IContent content) { - using (var repository = RepositoryResolver.Current.Factory.CreateUserRepository( - PetaPocoUnitOfWorkProvider.CreateUnitOfWork())) - { - return repository.GetProfileById(content.WriterId); - } + return ApplicationContext.Current.Services.UserService.GetProfileById(content.WriterId); } /// @@ -359,6 +347,7 @@ namespace Umbraco.Core.Models var x = content.ToXml(nodeName); x.Add(new XAttribute("nodeType", content.ContentType.Id)); + //TODO see below, do we have the same issues with GetXxxProfile threading problems? x.Add(new XAttribute("creatorName", content.GetCreatorProfile().Name)); x.Add(new XAttribute("writerName", content.GetWriterProfile().Name)); x.Add(new XAttribute("writerID", content.WriterId));