Updates GetProfile ext method to accept an IUserService so they can be mocked, this is now used by the entity serializer. Fixed examine unit tests that required this. Fixed: U4-5508 Remove cmsDocument.alias column from db, update the order in which tables are created since with the new foreign key, that order was incorrect.
This commit is contained in:
@@ -526,6 +526,7 @@ namespace Umbraco.Core.Models
|
||||
#endregion
|
||||
|
||||
#region User/Profile methods
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="IProfile"/> for the Creator of this media item.
|
||||
/// </summary>
|
||||
@@ -534,6 +535,14 @@ namespace Umbraco.Core.Models
|
||||
return ApplicationContext.Current.Services.UserService.GetProfileById(media.CreatorId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="IProfile"/> for the Creator of this media item.
|
||||
/// </summary>
|
||||
public static IProfile GetCreatorProfile(this IMedia media, IUserService userService)
|
||||
{
|
||||
return userService.GetProfileById(media.CreatorId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="IProfile"/> for the Creator of this content item.
|
||||
/// </summary>
|
||||
@@ -542,6 +551,14 @@ namespace Umbraco.Core.Models
|
||||
return ApplicationContext.Current.Services.UserService.GetProfileById(content.CreatorId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="IProfile"/> for the Creator of this content item.
|
||||
/// </summary>
|
||||
public static IProfile GetCreatorProfile(this IContentBase content, IUserService userService)
|
||||
{
|
||||
return userService.GetProfileById(content.CreatorId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="IProfile"/> for the Writer of this content.
|
||||
/// </summary>
|
||||
@@ -549,6 +566,15 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
return ApplicationContext.Current.Services.UserService.GetProfileById(content.WriterId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="IProfile"/> for the Writer of this content.
|
||||
/// </summary>
|
||||
public static IProfile GetWriterProfile(this IContent content, IUserService userService)
|
||||
{
|
||||
return userService.GetProfileById(content.WriterId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user