Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You got tricked by the ToString Override. Your object exists but it overrides the ToString Method : <a href="http://msdn.microsoft.com/en-us/library/system.web.security.membershipuser.tostring.aspx" rel="nofollow noreferrer">MembershipUser.ToString</a></p> <p>To validate this behavior, try it with a simple class :</p> <p>VB.NET</p> <pre><code>Public Class Test Public Property TestString As String Public Overrides Function ToString() As String Return Me.TestString End Function End Class </code></pre> <p>C#</p> <pre><code>public class Test { public string TestString { get; set; } public override string ToString() { return this.TestString; } } </code></pre> <p>With this code, the Watch will show you an instanciated Test to Nothing, because ToString value will be Nothing. The object exist, but Visual Studio is using the ToString Method to populate the value field, and at this point it is Nothing.</p> <p>VB.NET</p> <pre><code>Public Class Test Public Property TestString As String = "" Public Overrides Function ToString() As String Return Me.TestString End Function End Class </code></pre> <p>C#</p> <pre><code>public class Test { public Test() { this.TestString = ""; } public string TestString { get; set; } public override string ToString() { return this.TestString; } } </code></pre> <p>With this code you'll get an empty string.</p> <p>To get back to your code, you cannot extend the MembershipUser so simply, you have to follow this guideline : <a href="http://msdn.microsoft.com/en-us/library/ms366730(v=VS.100).aspx" rel="nofollow noreferrer">How to: Implement a Custom Membership User</a>. As many things won't work with your actual extension (For example, your username shadowing the base one).</p> <p>See <a href="https://stackoverflow.com/questions/901620/alternative-user-management-in-asp-net-mvc">this question</a> as well. There are easier ways to extend your user "entity" than inheritance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload