Skip to content

Linq2Sql entity - default value formatter runs into SQL queries #327

@drauch

Description

@drauch

For beginners it might not be obvious why a simple myEntityCollection.Should().NotContain(entity) executes SQL queries and (for bigger tables) takes forever due to the N+1 query problem.

The problem is that the DefaultValueFormatter tries to build an output string over many nesting levels of public properties in case ToString() is not overloaded (the default case for generated entites in Linq2Sql and afaik also for EntityFramework).

It would probably be best to always use ToString() and to enforce that the user explicitly must enable the DefaultValueFormatter's Public-Property-Via-Reflection-ToString behavior.

What are your thoughts on this issue?

BR, D.R.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions