I am trying to implement a registration prozess with email confirmation for my web application. I am using a IdentityServer3.AspNetIdentity service.
public class AspNetIdentityUserService<TUser, TKey> : UserServiceBase
where TUser : class, Microsoft.AspNet.Identity.IUser<TKey>, new()
where TKey : IEquatable<TKey>
{
My problem is the TUser which required the Microsoft.AspNet.Identity.IUser interface. In my implemented function the incoming user context is the right one but I do not have access to all attributes which you can see in the following two images.


http://img5.fotos-hochladen.net/uploads/b6aa42c662dd1kv063h4g5p.png http://img5.fotos-hochladen.net/uploads/d75b1e6462dd1wi9clqj6e7.png
Do you know how can I extend the Microsoft.AspNet.Identity.IUser to the effect that I have access to the attributes Lastname and Firstname?
Here TUser is a custom implemented class in IdentityServer3 which is inherited from IdentityUser for user identity.
You are not able to access these properties because TUser is object of IdentityServer3.Host.WebHost.AspId.User represented by base class IdentityUser or IUser.
The Quickwatch would show the object properties but it wouldn't appear in intellisense.
You need to cast the TUser to IdentityServer3.Host.WebHost.AspId.User.
var user = new TUser() as IdentityServer3.Host.WebHost.AspId.User;
user.FirstName = "Tester";
user.LastName = "Doer";
This should give you the workaround.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With