I am creating an entity using Power Tools. How do i capture the current Logged In user 'Id' and 'TennentId' to update the fields the the database for that table
3 Answer(s)
-
0
Hi
You can use the AbpSession extension to get the information of the logged in user. You can get it by calling
AbpSession.GetTenantId()
,AbpSession.GetUserId()
methods. If you want to get UserIdentifier as well. You can use it asAbpSession.ToUserIdentifier()
. -
0
Hi
You can use the AbpSession extension to get the information of the logged in user. You can get it by calling
AbpSession.GetTenantId()
,AbpSession.GetUserId()
methods. If you want to get UserIdentifier as well. You can use it asAbpSession.ToUserIdentifier()
.So you cant get it from Add New Navigation Property in Power Tools?
Select Your Entity Like User (x.x.Authorization.Users.long ?
I would have to create the Property in PowerTool and then update it in code to use
AbpSession.GetUserId()
-
0
Hi
Yes, when creating the relevant entity, you can filter by user by associating the User in the Navigation Property with the user you selected, as you said, you will need to update it manually. Here, you can condition it by taking the logged in user instead of the user information in the input.