0
I need to make the persistence of inclusions, changes and exclusions that users make on the system, each drive that the user only sees, so I created a Id
on the tables of my BD to know which user is recording the data.
I was using the Session, when the user logged in I assigned Session with the Id
of the user on BD, this caused several problems because the IIS ago Recycle of pool and clears the data of Sessions.
So I decided to use the FormsAuthenticationTicket
since I can use the role in the user_data
, and the login, but I cannot assign the ID
user, so I created a Select in the DAO that returns the ID
of my user with filter on login_name
which is unique. But I realized that it slowed down Session, for obvious reasons.
- I would like to know if this is best practice? or
- if there is a better solution?
But how would I access these attributes in my CRUD? I would instate the base class in the controller, I would pass the Ids up to there ok. My question is how would I access this information in the CRUD class? I understand that I could not use Static.
– lorranpalmeira
base class is not for controller but for objects(entities), db needs to be modified to support the first option, if you use Migration and only implement the base class and run Migration
– HudsonPH
and in the CRUD part Voce need to create an override or even edit, to save lastdate and userid
– HudsonPH
if you have difficulty in this part, better create the log system, every time the crud is used you make the call to log() to save what was done
– HudsonPH
Thank you Hudson.I will study this implementation.
– lorranpalmeira