Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

How to get current UserId in asp.net core+angular #5726


User avatar
0
[email protected] created

How to get current UserId in asp.net core+angular


1 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    From the documentation on Abp Session:

    public class MyClass : ITransientDependency
    {
        public IAbpSession AbpSession { get; set; }
    
        public MyClass()
        {
            AbpSession = NullAbpSession.Instance;
        }
    
        public void MyMethod()
        {
            var currentUserId = AbpSession.UserId;
            //...
        }
    }