Moved application logic into Core which are now 'Sections'. Have proxied all calls from the legacy application to sections. Streamlined how automapper configs are registered (much better now). Updated some unit tests to use the new classes instead of the legacy ones. Created the sections controller to return the sections from the back office. Changed the TypeFinder to search all types not just public ones, changed the boot managers to not have to explicitly modify the resolvers with internal types because now internal types are automatically found.
This commit is contained in:
@@ -1,26 +1,27 @@
|
||||
using System;
|
||||
using AutoMapper;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models.Mapping;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
|
||||
namespace Umbraco.Web.Models.Mapping
|
||||
{
|
||||
internal class UserModelMapper
|
||||
internal class UserModelMapper : MapperConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Configures the automapper mappings
|
||||
/// </summary>
|
||||
internal static void Configure()
|
||||
|
||||
#region Mapper config
|
||||
public override void ConfigureMappings(IConfiguration config)
|
||||
{
|
||||
Mapper.CreateMap<IUser, UserDetail>()
|
||||
config.CreateMap<IUser, UserDetail>()
|
||||
.ForMember(detail => detail.UserId, opt => opt.MapFrom(user => GetIntId(user.Id)))
|
||||
.ForMember(
|
||||
detail => detail.EmailHash,
|
||||
opt => opt.MapFrom(user => user.Email.ToLowerInvariant().Trim().ToMd5()));
|
||||
Mapper.CreateMap<IProfile, UserBasic>()
|
||||
config.CreateMap<IProfile, UserBasic>()
|
||||
.ForMember(detail => detail.UserId, opt => opt.MapFrom(profile => GetIntId(profile.Id)));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
private static int GetIntId(object id)
|
||||
{
|
||||
@@ -41,6 +42,6 @@ namespace Umbraco.Web.Models.Mapping
|
||||
public UserBasic ToUserBasic(IProfile profile)
|
||||
{
|
||||
return Mapper.Map<UserBasic>(profile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user