MemberService.Created - Name of member returns login name [v7.2.1]
Hey,
When I create a member, I'd like to generate a member group name using the name of the newly created member. However, when I access the Entity.Name property I seem to get the login name. Is this a bug or by design?
It looks like I'll have to use Examine in order to extract the node name. I thought the Entity.Name property would contain that information, but I guess not.
MemberService.Created - Name of member returns login name [v7.2.1]
Hey,
When I create a member, I'd like to generate a member group name using the name of the newly created member. However, when I access the Entity.Name property I seem to get the login name. Is this a bug or by design?
[code]
//My ApplicationEventHandler implementation
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
MemberService.Created += OnMemberCreated;
}
private void OnMemberCreated(IMemberService sender, NewEventArgs arguments)
{
if (arguments.Alias == "Clients")
{
var memberGroupName = string.Format("{0} - {1}", arguments.Alias, arguments.Entity.Name);
sender.AssignRole(arguments.Entity.Id, memberGroupName);
}
}[/code]
Thanks,
David
This blog package also shows the name: http://24days.in/umbraco/2014/managing-members/. Maybe the source code at the bottom can help.
Jeroen
It looks like I'll have to use Examine in order to extract the node name. I thought the Entity.Name property would contain that information, but I guess not.
Thanks!
is working on a reply...