Last post Oct 05, 2018 10:09 AM by mwinner
Oct 04, 2018 07:26 PM|mwinner|LINK
I would appreciate any help.
I have a class (in Core) in my app that I use to pass around basic information such as the user, connection strings, IP address... I pass a interface of this class to the the constructor of the controller which gets passed in using DI. My company likes logging
all actions that are done by our reps, and it came to my attention that every so often this class gets mixed up, basically user A does a action which I would then go ahead and log, but the information gets saved as if User B initiated the action with all of
users B info i.e. IP address....
The actual logging is done through a static method, however I am passing this class to the (static) logging method every time I need to log an action and the class itself is a private field. I would appreciate any clue how this is possible.
Oct 04, 2018 07:43 PM|mgebhard|LINK
This is usually the result of a static member. A static method is tread safe but a static member is not. It can also be due to a logical bug.
Oct 05, 2018 10:09 AM|mwinner|LINK
Thanks a lot. Looking deeper in the code, it seems that there was a static member being used.