Open Omzig opened 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.
That's actually not a bad idea. I will consider incorporation! Thanks for your feedback.
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.