سلام . من در برنامم دو تا role فروشنده و خریدار دارم که بعضی فیلدهای پروفایل برای هر دوی اونها مشترک هست و بعضی فرق میکنه. کاری که من انجام دادم در ApplicationUser به این شکل هست:
public class ApplicationUser : IdentityUser
{
public virtual Seller Seller { get; set; }
public virtual Customer Customer { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationU ser> manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
}
میخواستم ببینم آیا این راه درست هست؟ آیا راه بهتری برای پیاده سازی این موضوع وجود نداره؟
ممنون