با سلام
برای مدل User شما از Int استفاده کرده اید من با توجه به ساختار کل پروژه که از Guid استفاده میکنیم مدل user رو به صورت زیر تغییر داده ام
public class User : IdentityUser<Guid, UserLogin, UserRole, UserClaim>
حال در سرویس ApplicationUserManager در متد GetCurrentUserId به صورت زیر پیاده سازی شده است
public Guid GetCurrentUserId() { return _identity.GetUserId<Guid>(); }
که بعد از کامپایل خطای زیر داده میشود
The type 'System.Guid' cannot be used as type parameter 'T' in the generic type or method 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserId<T>(System.Security.Principal.IIdentity)'. There is no boxing conversion from 'System.Guid' to 'System.IConvertible'
آیا فقط نوع داده باید int باشد؟