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
I'm new. I am doing a lot of testing for a project I've taken on that requires importing csv list of members. This testing requires removing the members from the database. The Our.Umbraco documentation for removing all members looked easst to implement using:
var memser = Services.MemberService;
The Umbraco documentation indicates:
"Deletes all members of a given type"
Nowhere can I find the function that returns the integer value of the "Members" MemberType.
As a workaround, using the Visual Studio the SQL Server Compact/SQLite Toolbox, I was able to find the value "1044" in the cmsMemberType table.
What code will return that integer value of a named MemberType?
Using the MemberTypeService - https://our.umbraco.org/documentation/reference/management/services/MemberTypeService :
var memberType = ApplicationContext.Current.Services.MemberTypeService.Get("myMemberTypeAlias");
var memberTypeId = memberType.Id;
Thank you for your prompt answer. I suspect that other newbees would benefit if your answer was part of the documentation. I will humbly suggest adding your answer as an example to the documentation. If that was part of the current documentation, inexperienced persons like me would not be posting a question like this.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted