Skip to content

ITable<T> extension methods should return new ITable instance instead of modified instance, passed to them #1274

@MaceWindu

Description

@MaceWindu

We have some extension methods (need to identify all such methods), that we can apply to ITable instance. User will expect that calling such method on table object will not modify initial object, but return new modified copy.

E.g. of unexpected behavior:

var table = db.GetTable<SomeTable>();

// here With will add hint to table instance instead of returning new instance
table.With(hint).Select().ToList();

// here we will generate query with table having hint from select query!
table.Set(r => r.Field, someValue).Update();

Environment details

linq2db version: 2.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions