henkmollema / Dommel

CRUD operations with Dapper made simple.
MIT License
634 stars 100 forks source link

Add deletion by id / ids #170

Closed tanguy-c closed 4 years ago

tanguy-c commented 4 years ago

Hi ! It's not an issue but it would be nice to have deletion by id and ids As you do "con.Get\(1);" you could do "con.Delete\(1);"

henkmollema commented 4 years ago

You can achieve this by doing:

con.Delete(new Product { Id = 1 });

I agree it's a bit hacky. Perhaps adding support for deletion by ID would be nice.

lucaxchaves commented 4 years ago

Why not use?

con.DeleteMultiple<Product>(product => product.Id == 1);
henkmollema commented 4 years ago

On a second thought I think both options are viable and do not warrant a new method to be added.

tanguy-c commented 4 years ago

True ! :) And I didn't know DeleteMultiple existed. (Could be nice to have it in a documentation) Anyway, nice job guys ! For now i'm only using FluentMap, but I keep Dommel in mind. Have a nice day, and maybe quarantine ;)