How to set a custom property of a member with the new API?
I have a very simply custom MembershipProvider like
public class customMembershipProvider: umbraco.providers.members.UmbracoMembershipProvider{
....
...
MembershipUser member = Membership.GetUser(username);
if (member == null)
{
member = Membership.CreateUser(username, password, email);
Roles.AddUserToRole(member.UserName, DEFAULT_MEMBER_GROUP);
// the above works fine, but setting property wont work:
member.SetProperty("customproperty", "hello");
----^
..
}
throws System.Web.Security.MembershipUser' does not contain a definition for 'SetProperty'
We use the MemberService to update/create our members.
Here is some example code that works for us using the memberservice
var service = ApplicationContext.Current.Services.MemberService;
var member = service.GetById(memberId);
if (member == null)
{
return false;
}
member.SetValue("Adddress", "address string goes here");
service.Save(member);
Setting Custom property witin MembershipProvider
How to set a custom property of a member with the new API?
I have a very simply custom MembershipProvider like
throws System.Web.Security.MembershipUser' does not contain a definition for 'SetProperty'
Also tried:
without success, as it complains no such method MemberProperties.
Any ideas on how to set a custom property of a member just created?
Hi Keilo,
We use the MemberService to update/create our members.
Here is some example code that works for us using the memberservice
You can find the memberservice docs here : https://our.umbraco.org/documentation/Reference/Management/Services/MemberService
Dave
is working on a reply...