title: get current user email in Identity
body: <p>I use <code>IIdentity</code> interface For Getting current <code>userid</code> and <code>username</code>.</p>
  
  <p>so implement following Method: </p>
  
  <pre><code>private static IIdentity GetIdentity()
  {
      if (HttpContext.Current != null &amp;&amp; HttpContext.Current.User != null)
      {
          return HttpContext.Current.User.Identity;
      }
  
      return ClaimsPrincipal.Current != null ? ClaimsPrincipal.Current.Identity : null;
  }
  </code></pre>
  
  <p>And Add this code: <code>_.For&lt;IIdentity&gt;().Use(() =&gt; GetIdentity());</code> in my IoC Container<code>[structuremap]</code>.</p>
  
  <p><strong>Usage</strong></p>
  
  <pre><code>this._identity.GetUserId();
  this._identity.GetUserName();
  this._identity.IsAuthenticated
  </code></pre>
  
  <p>Now I Want to Implement <code>GetEmailAdress</code> Method, How To do this?</p>
  
  <p><strong>Example</strong> </p>
  
  <pre><code>this._identity.GetEmailAdress();
  </code></pre>
  
  <p>When use <code>this._identity.GetUserName();</code> do not get username form <strong>database</strong>.</p>