SaaS CMS has officially launched! Learn more now.

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


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.

Feb 01, 2023 21:25

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

Feb 02, 2023 11:48

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,

Feb 02, 2023 15:48

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


Feb 02, 2023 15:59

I think that is going to work!

Thanks Quan!

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.