c# - Detect customer profile changes -
i'm trying figure how write linq query return list of customers changed address on given date
cusomters - name (nvarchar) - address (nvarchar) - checkindate (datetime)
i first list of customers checked in on date loop through each customer , customer's check ins see if there changes. result in numerous database queries. there more efficient way this?
this detect customers changed addresses yourdate
.
var result = customers.where(c=>c.checkindate <= yourdate) .groupby(c=>c.name) .where(g=>g.groupby(c=>c.address).count() > 1) .selectmany(x=>x);
Comments
Post a Comment