3 ms·
This is where I think LINQ does a good job. var coworkers = departments.selectMany(department => department.employees); Nearly equivalent to the Scala code,
by relevate 11y ago
This is where I think LINQ does a good job.
var coworkers = departments.selectMany(department => department.employees);
Nearly equivalent to the Scala code, but uses more approachable keywords like `select`, `selectMany`, and `where` instead of `map`, `flatMap`, and `filter`.
- domlebo70 11y agoOr people could just learn the correct terminology.
- douche 11y agoIt makes a lot of sense in .NET land, because it maps to SQL, which people tend to have some kind of grasp on. Although that LINQ expression syntax can go die in a fire. It's a great way to end up with people using borked up joins in Linq-to-SQL and EF that don't work the way they think they do, rather than the actual foreign-key relationships.