I asked this question in a much longer way a few days ago , and the fact that I have no answers is not surprising given the length, so I decided that I would get more.
I have to decide on how to display the user based on their assignment to a particular client. The domain object is as follows:
public class Customer
{
public string Name { get; set; }
public IEnumerable<Users> AssignedUsers { get; set; }
}
In the real world, I will also evaluate whether they have permissions (using bitwise comparisons on the security flags) to view this particular client, even if they are not directly assigned to it.
I am trying to adhere to the principles of domain-based rules (DDD). In addition, I use LINQ to SQL to access data. At my service level, I provide the user with a list of customers request, which now amounts to about 1000 items and is growing at about 2% per month.
If I strictly follow the logic at my service level, I will need to use Linq to execute .Where, which evaluates whether the list contains AssignedUsersa user request. This will cause a cascade of requests for each Customeras the system enumerates. I have not tested, but it seems to be ineffective.
no-logic-in-the-data, GetCustomersByUser(), EXISTS SQL . , , , , , .
, , , Linq... , ? Linq , ?