November Happy Hour will be moved to Thursday December 5th.

Use Mediachase.Commerce.Security.SecurityContext.Current.CurrentUserProfile in Opti 12 .net core

Vote:
 

Hi All,

I'm migrating to Opti12 .net core and ran into this class "CurrentUserProfile" which is part of the ProfileBase class that no longer exists in Opti12, this is the piece of code with the issue:

var profile = Mediachase.Commerce.Security.SecurityContext.Current.CurrentUserProfile as Mediachase.Commerce.Customers.Profile.CustomerProfileWrapper;

I've looking for an equivalent in Opti12 with no luck.

Has anybody else ran into the same issue? What should I use in Opti12 that replace the "SecurityContext" and "ProfileBase".

Any help is appreciated.

Thanks in advance.

#295754
Feb 01, 2023 21:25
Vote:
 

ProfileBase is not available on .net core, so CurrentUserProfile and SecurityContext were removed in Commerce 14. what do you want to do with it ?

#295808
Feb 02, 2023 11:48
Vote:
 

Hi Quan,

I have this piece of code that needs to be migrated to .net core. There is this State property which belongs to the ProfileBase

I need to develop a equivalent logic to accomplish the one above but I don't know what to properly use in .net core.

Really appreciate any help.

Thanks in advance,

#295814
Feb 02, 2023 15:48
Vote:
 

I assume these are meant for checking locked user. If you are using AspNetIdentity, you can simply get the current user, and then

ApplicationUser.IsLockedOut 

#295815
Feb 02, 2023 15:59
Vote:
 

I think that is going to work!

Thanks Quan!

#295817
Feb 02, 2023 16:13
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.