adamfoneil/Dapper.Entities

select-column CRUD statements

Closed this issue · 1 comments

At least for inserts and updates, I'd like to be able to target select columns -- using either lambda-based expressions like this:

// insert just the Name and Description columns
await cn.InsertRowAsync<Item>(row, row => row.Name, row => row.Description);

// update just the Price column
await cn.UpdateRowAsync<Item, int>(row.Id, row => row.Price);

or maybe Dictionary-based statements. I know I've done this before, but the underlying SQL builder was something one-off. I'd like to leverage the existing ISqlBuilder (extending it as needed) because I like its platform-agnosting metadata discovery.

await cn.UpdateRowAsync<Item, int>(new()
{
    ["Name"] = "whatever",
    ["Description"] = "some description",
    ["Price"] = 232
});

Not doing insert statements, but will do updates.