We have moved to GitHub Issues
Created by Stephan 05 Apr 2016, 12:29:04 Updated by Shannon Deminick 12 Apr 2016, 13:13:06
Is required for: U4-5544
At the moment most queries look like:
var sql = new Sql()...Where
I.e. the SqlSyntax needs to be passed around everywhere. With NPoco and some changes, we also need to pass around the IPocoDataFactory that countains the tables & columns definitions, amongst other things.
This is going to complexify these Where
var sql = Sql.Builder(database).Where
I.e. have an UmbracoSql class inheriting from Sql and containing references to the various things that are needed.
part of PR https://github.com/umbraco/Umbraco-CMS/pull/1207 all done
syntax now is: var sql = new Sql().For(sqlContext).Select(...);
where sqlContext is an SqlContext object that contains the SqlSyntax, DatabaseType, and IPocoDataFactory. In the base repository I've created a helper method, so syntax can actually be: var sql = Sql().Select(...);
Makes for much ligther code. Currently discussing with Adam re. how this could be part of NPoco which would be super cool.
Backwards Compatible: True
Due in version: 8.0.0
Sprint: Sprint 13