c# - EF Query - SQL "IN" - Same Table -
I need to get a list of In other words, if the current user does not have any connection with the organization in question, no results are returned. If there is a relationship then the results will be returned. This is a query yet, but it is only reusing an existing user for a user. The questions below will clearly get all the active If you can do something like: user whose code
organization .
UserOrganization records where the value in the
Organization ID query matches my question. Is that how do I take my current user (
UserId ) and make sure they set this result before returning to the record, then should not be able to see them?
var dbUsers = db.UserOrganizations Where (u = & gt; u.OrganizationId == Organization ID). If if (active, u = & gt; u.IsActive)
var dbUsers = db.Organizations Where (o = & gt; O.OrganizationID == Organization ID & amp; User Anyone (U = & gt; u.UserId == Current User & amp; amp; U.E.Active)) Selecting (many = o = user.)
user through an
organization / P>
var dbUsers = db.Organizations. Where (o = & gt; O OrganizationId == Organization ID & amp; O User Organization. Any (U = & gt; u.User.UserId == Current User & amp; u.User.IsActive) Selection multiple (o => user user organization) (Uo = & gt; uo.User)
Comments
Post a Comment