I have recently been exploring the concept of Row Level Security in my application. At current, I can implement a very basic version of it on my SQL database. I have run a couple of SQL statements to create basic predicates and apply them to tables. I have also created SQL Users as per the examples I have seen online.
To take this further, I would like to integrate this with my MVC Entity Framework application but have hit a few issues.
Using SQL Server Management Studio, to test my row level security, I have to start all my sql queries with "EXECUTE AS USER = ...." and end my queries with "REVERT".
My question here is how this is accomplished via C# ? I had all my LINQ queries performing as expected but now I want them to be filtered using Row Level Security.
Any help is appreciated.
Thanks