Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi everyone,
We are redoing an old website made inumbraco 7 with umbraco 9. On umbraco 7 to get the current member in a controller we used to do this
var memHelper = new MembershipHelper(UmbracoContext.Current); var member = memHelper.GetCurrentMember();
But MembershipHelper seems to not be available anymore in Umbraco 9.
Do you know what is the alternative for this?
Thanks!.
There is a IMemberManager instead, as far as I can see: https://apidocs.umbraco.com/v9/csharp/api/Umbraco.Cms.Core.Security.IMemberManager.html#methods
So you'd inject IMemberManager into your controller and await GetCurrentMemberAsync() instead, maybe?
EDIT: here's a better explanation :-) https://our.umbraco.com/documentation/Reference/Querying/IMemberManager/
That's the one, thank you very much!
Excellent! And BTW, remember to mark as solution so people can see there's help to get here :-D
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
MembershipHelper in umbraco 9
Hi everyone,
We are redoing an old website made inumbraco 7 with umbraco 9. On umbraco 7 to get the current member in a controller we used to do this
But MembershipHelper seems to not be available anymore in Umbraco 9.
Do you know what is the alternative for this?
Thanks!.
There is a IMemberManager instead, as far as I can see: https://apidocs.umbraco.com/v9/csharp/api/Umbraco.Cms.Core.Security.IMemberManager.html#methods
So you'd inject IMemberManager into your controller and await GetCurrentMemberAsync() instead, maybe?
EDIT: here's a better explanation :-) https://our.umbraco.com/documentation/Reference/Querying/IMemberManager/
That's the one, thank you very much!
Excellent! And BTW, remember to mark as solution so people can see there's help to get here :-D
is working on a reply...