Made som mock code below to illustrate my example. The problem is the lambda expression. If I leave it as in the code example it will not serialize when I try to call the service. However if I type .ToList()
after the lambda it serializes as it should.
Why is that? I can't see why the code below should not work... Anyone care to enlighten me? :)
var list = new EntityPerson
{
Names = modelPerson.Names.Select(
n => new EntityName
{
Text = n.Text
})
}