C # join () even table query

Result dogs.Where = var (D => d.Id>. 1) .join (Masters, D => d.MasterId, m => m.Id,
(D, m) => {DogName new new = d.name, MasterName = m.Name});
in the dog set of query data dog.Id greater than 1. Masters connected table (set), d => d.MasterId left table refers to the field (attributes dog MasterId) m => m.Id refers field (master Id) right table.
(d, m) => new {DogName = d.Name, MasterName = m.Name} refers to the results of the query.
The process of creating a new anonymous collection of objects, anonymous objects have DogName and MasterName property.

Guess you like

Origin www.cnblogs.com/sunny3158/p/11694325.html