SyntaxFix
Write A Post
Hire A Developer
Questions
This works for me:
val personsMap = persons.foldLeft(scala.collection.mutable.Map[Int, PersonDTO]()) { (m, p) => m(p.id) = p; m }
The Map has to be mutable and the Map has to be return since adding to a mutable Map does not return a map.