How To Get All Current User Details in a Blazor component

Hello !

I have a custom user table as follows :


[Id] [int] IDENTITY(1,1) NOT NULL,
[Email] [nvarchar](max) NULL,
[Username] [nvarchar](max) NULL,
[UserFirstName] [nvarchar](max) NULL,
[UserLastName] [nvarchar](max) NULL,
[DateOfBirth] [datetime2](7) NOT NULL,
[UserRole] [nvarchar](max) NULL,
[IsConfirmed] [bit] NOT NULL,
[IsDeleted] [bit] NOT NULL,
[DateCreated] [datetime2](7) NOT NULL,

Please tell me how to store all the user fields into a global variable on successful login. I want to be able to access all the user data every time I want into my pages ! This user table is for general purpose only. The user fields may be different in a real situation.

What I need is : I want to be able to access and store as global variable all needed logged user details so I can access it when and if I need that data !

Thank you very much !


1 Reply

JL Joshna Lingala Uthama Reddy Lingala Syncfusion Team May 31, 2022 12:33 PM UTC

Hi Tom,


Greetings from Syncfusion.


We have checked the reported query. Please refer the below links for your requirement


https://docs.microsoft.com/en-us/aspnet/core/blazor/state-management?view=aspnetcore-6.0

https://social.msdn.microsoft.com/Forums/en-US/ee381f25-10e0-47d8-8991-12e30ec0176b/how-to-get-a-list-of-all-users-currently-logged-in-with-aspnet-mvc-3?forum=aspmvc


Kindly try with the above information and get back to us if you have any queries.


Regards,

Joshna L


Loader.
Up arrow icon