Fixes tests and issue with member list view not passing the GUID along in the route
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
//FROM MembershipUser TO IMember - used when using a non-umbraco membership provider
|
||||
CreateMap<MembershipUser, IMember>()
|
||||
.ConstructUsing(src => MemberService.CreateGenericMembershipProviderMember(src.UserName, src.Email, src.UserName, ""))
|
||||
//we're giving this entity an ID of 0 - we cannot really map it but it needs an id so the system knows it's not a new entity
|
||||
//we're giving this entity an ID of int.MaxValue - TODO: SD: I can't remember why this mapping is here?
|
||||
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => int.MaxValue))
|
||||
.ForMember(dest => dest.Comments, opt => opt.MapFrom(src => src.Comment))
|
||||
.ForMember(dest => dest.CreateDate, opt => opt.MapFrom(src => src.CreationDate))
|
||||
@@ -84,6 +84,8 @@ namespace Umbraco.Web.Models.Mapping
|
||||
|
||||
//FROM IMember TO MemberBasic
|
||||
CreateMap<IMember, MemberBasic>()
|
||||
//we're giving this entity an ID of int.MaxValue - this is kind of a hack to force angular to use the Key instead of the Id in list views
|
||||
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => int.MaxValue))
|
||||
.ForMember(dest => dest.Udi, opt => opt.MapFrom(content => Udi.Create(Constants.UdiEntityType.Member, content.Key)))
|
||||
.ForMember(dest => dest.Owner, opt => opt.ResolveUsing(src => memberOwnerResolver.Resolve(src)))
|
||||
.ForMember(dest => dest.Icon, opt => opt.MapFrom(src => src.ContentType.Icon))
|
||||
@@ -99,7 +101,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
|
||||
//FROM MembershipUser TO MemberBasic
|
||||
CreateMap<MembershipUser, MemberBasic>()
|
||||
//we're giving this entity an ID of 0 - we cannot really map it but it needs an id so the system knows it's not a new entity
|
||||
//we're giving this entity an ID of int.MaxValue - TODO: SD: I can't remember why this mapping is here?
|
||||
.ForMember(dest => dest.Id, opt => opt.MapFrom(src => int.MaxValue))
|
||||
.ForMember(dest => dest.Udi, opt => opt.Ignore())
|
||||
.ForMember(dest => dest.CreateDate, opt => opt.MapFrom(src => src.CreationDate))
|
||||
|
||||
Reference in New Issue
Block a user