This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -93,12 +93,16 @@ From v4.0.16 you can now use typed sql expressions in Custom SQL API's
9393
9494``` csharp
9595List < Person > results = db .SqlList <Person >(db .From <Person >().Select (" *" ).Where (q => q .Age < 50 ));
96+ List < Person > results = db .SqlList <Person >(" SELECT * FROM Person WHERE Age < @age" , new { age = 50 });
9697
97- List < string > results = db .SqlColumn <string >(db .From <Person >().Select (x => x .LastName );
98+ List < string > results = db .SqlColumn <string >(db .From <Person >().Select (x => x .LastName ));
99+ List < string > results = db .SqlColumn <string >(" SELECT LastName FROM Person" );
98100
99- HashSet < int > results = db .ColumnDistinct <int >(db .From <Person >().Select (x => x .Age );
101+ HashSet < int > results = db .ColumnDistinct <int >(db .From <Person >().Select (x => x .Age ));
102+ HashSet < int > results = db .ColumnDistinct <int >(" SELECT Age FROM Person" );
100103
101104int result = db .SqlScalar <int >(db .From <Person >().Select (Sql .Count (" *" )).Where (q => q .Age < 50 ));
105+ int result = db .SqlScalar <int >(" SELCT COUNT(*) FROM Person WHERE Age < 50" );
102106```
103107
104108## New Simplified API
You can’t perform that action at this time.
0 commit comments