Closed michaelswells closed 2 years ago
Since you are setting the context for the session, it sounds like the best place would be to set the user when you get the connection.
Maybe something like:
interface IDbSession {
[SQL("sp_set_session_context")]
void setSessionContext(string attribute, string value);
}
public IDbConnection GetDbSession(string username) {
var sc = Connection().As<IDbSession>();
sc.setSessionContext("username", username);
return sc as IDbConnection;
}
// somewhere else
i = GetDbSession(username).As<MyInterface>();
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I have an application that uses the [SQL()] attribute in the Repository layer
I am now trying to implement Row Level Security (RLS) and I would [IMO] need to prefix all calls with
Would I need to change the original to:
or is there a simpler solution?