nhlpa / Sequel

.NET SQL builder that emulates writing SQL.
MIT License
18 stars 3 forks source link

Mapper V2 Request #2

Open Omzig opened 5 years ago

Omzig commented 5 years ago

It would be really awesome if the mapper was upgraded to a "Fluent" version. E.G.

var sqlMapper = new SqlMapper();

var sqlString = sqlMapper.Select(rec => rec.Id) .From("MockEntity") .Where(rec => rec.Id = "1") .ToString()

Or somehow merge it into a LINQ type statement to form the SQL string. Or maybe create an SQLBuilder that accepts a type.

var sqlQuery = new SqlBuilder() .Select(rec => rec.Id) .From("MockEntity") .Where(rec => rec.Id = "1");

I really like how LINQ works, it is a shame that we cannot use that same concept here.

pimbrouwers commented 5 years ago

That's actually not a bad idea. I will consider incorporation! Thanks for your feedback.