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
93
93
94
94
``` csharp
95
95
List < 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 });
96
97
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" );
98
100
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" );
100
103
101
104
int 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" );
102
106
```
103
107
104
108
## New Simplified API
You can’t perform that action at this time.
0 commit comments