J
Johan Karlsson
Hi!
I'm new to both Linq and Entity Framework and I have a simple question based
on a code example.
Given the query below
var query = from c in context.Customers
where c.Roles.Any( e => e.User.Id == userId ) &&
c.SomeOtherProperty == SomeOtherValue
select c;
Is it possible to refactor out part of the where clause for security
reasons, so you don't end up with a bunch of different places that could
over time differ?
Something like
var query = from c in context.Customers
where BuildSecurityExpression() &&
c.SomeOtherProperty == SomeOtherValue
select c;
Thanks
// Johan
I'm new to both Linq and Entity Framework and I have a simple question based
on a code example.
Given the query below
var query = from c in context.Customers
where c.Roles.Any( e => e.User.Id == userId ) &&
c.SomeOtherProperty == SomeOtherValue
select c;
Is it possible to refactor out part of the where clause for security
reasons, so you don't end up with a bunch of different places that could
over time differ?
Something like
var query = from c in context.Customers
where BuildSecurityExpression() &&
c.SomeOtherProperty == SomeOtherValue
select c;
Thanks
// Johan