Skip to content

Examples

Austin edited this page Jul 28, 2019 · 2 revisions

These are currently in various states of working (code coming soon) but give an outline of the syntax.

Select

var query = Chic.From(); var listOfDtos = dapper.Execute(query);

Select from Dto to a business model:

var chic = new Chic(); chic.From<DtoSource, BusinessModel>(); List results = dapper.Execute(chic.GetQuery());

Join

var chic = new Chic(); chic.From(); chic.Join<LeftTable, RightTable>(joinOn => joinOn.MatchingKeyName); chic.Join<RightTable, AThirdTable>(join => join.RightKey, join.AThirdtableForeignKey); dapper.Execute(chic.GetQuery);

Selecting for columns

OrderBy

//Ascending: chic.OrderBy(o => o.ColumnName);

//Descending, use optional enum chic.OrderBy(o => o.ColumnName, Direction.Descending);

From Database DTO / Entities to Business / View Models.