shapper wrote:
> Hello,
>
> I have a class as follows:
>
> public class UserPaper {
> public MembershipUser user { get; set; }
> public string Password { get; set; }
>
> public UserLeaf(MembershipUser newUser) {
> UserLeaf(newUser, null);
> }
> public UserLeaf(MembershipUser newUser, string password) {
> this user = newUser;
> this password = password;
> }
> }
>
> I simplified my code but basically I get the following error:
> 'UserPaper' is a 'type' but is used like a 'variable'
>
> Do I need to repeat the definition in all methods? I am a little bit
> confused.
I think you want the following:
public class UserPaper {
public MembershipUser User { get; set; }
public string Password { get; set; }
public UserPaper(MembershipUser newUser): this(newUser, null){
}
public UserPaper(MembershipUser newUser, string newPassword) {
User = newUser;
Password = newPassword;
}
}
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/