Can you advise me on setting up an empty constructor for a SiteMember? I would like to hve somehting like
SiteMember mp = new SiteMember();
and then in my SiteMember class have a constructor like
public SiteMember() { }
but as this class derives from membertypebase, I cannot set up a constructor that takes 0 args. I have a workaround for my situation but it involves checking if each member property exists so it would be nice if there is a simple way to achieve the above (so my member properties are initialised as nulls or empty strings) if possible.
Can you specifiy why do you need empty constructor. When you write something like this:
SiteMember mp = new SiteMember();
You are actually creating new member but creating new member is not possible without login, email and password information so that's why there is no empty constructor.
I am trying to reuse the same control for creating a member and updating a member profile. I can do it but without being able to instatiate an empty member (not actually creatinging it in the Umbraco DB) it is quite long winded.
I see. Well, I don't see a way to create Member instance without mentioned required parameters. Also, Umbraco's Member class (umbraco.cms.businesslogic.member.Member) you can not create with empty constructors:
Never mind, I have a workaround it was more a nice to have than anyhting. I can see why it is impractical as the underlying Umbraco class has no facility for creating an empty member.
SiteMember empty constructor
Can you advise me on setting up an empty constructor for a SiteMember? I would like to hve somehting like
SiteMember mp = new SiteMember();
and then in my SiteMember class have a constructor like
public SiteMember()
{ }
but as this class derives from membertypebase, I cannot set up a constructor that takes 0 args. I have a workaround for my situation but it involves checking if each member property exists so it would be nice if there is a simple way to achieve the above (so my member properties are initialised as nulls or empty strings) if possible.
Can you specifiy why do you need empty constructor. When you write something like this:
SiteMember mp = new SiteMember();
You are actually creating new member but creating new member is not possible without login, email and password information so that's why there is no empty constructor.
I am trying to reuse the same control for creating a member and updating a member profile. I can do it but without being able to instatiate an empty member (not actually creatinging it in the Umbraco DB) it is quite long winded.
I see. Well, I don't see a way to create Member instance without mentioned required parameters. Also, Umbraco's Member class (umbraco.cms.businesslogic.member.Member) you can not create with empty constructors:
Never mind, I have a workaround it was more a nice to have than anyhting. I can see why it is impractical as the underlying Umbraco class has no facility for creating an empty member.
is working on a reply...