Skip to content

Delete multiple rows directly by Query #16

@MikaelEliasson

Description

@MikaelEliasson

Something similar to:

db.SetX.DeleteWhere(b => b.Created < limit && b.Title == "T2.0");

The code to generate the filter is already there. The tricky part is that delete is a bit more complicated with joins than select is. If there are any local entities (do you have those in L2S?) that match the predicate I guess they should be deleted too.

In EFUtilities I decided to have this kind of operations outside the DbContext because they are "power functions" + work differently from the normal workflow. Not sure what would be best.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions