Skip to content

Commit

Permalink
added dapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatandrei committed Dec 13, 2024
1 parent d8045ca commit 2056259
Show file tree
Hide file tree
Showing 28 changed files with 623 additions and 34 deletions.
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RSCG - 173 Examples of Roslyn Source Code Generators / 14 created by Microsoft /
# RSCG - 174 Examples of Roslyn Source Code Generators / 14 created by Microsoft /

## Latest Update : 2024-12-01 => 01 December 2024
## Latest Update : 2024-12-02 => 02 December 2024

If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***

Expand All @@ -20,8 +20,30 @@ If you want to be notified each time I add a new RSCG example , please click htt

## Content

Those are the 173 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 174 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 14 from Microsoft )
### 174. [Dapper.AOT](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dapper.AOT) , in the [Database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) category

Generated on : 2024-12-02 => 02 December 2024

<details>
<summary>Expand</summary>



Author: Marc Gravell

Build time (AOT) tools for Dapper

Nuget: [https://www.nuget.org/packages/Dapper.AOT/](https://www.nuget.org/packages/Dapper.AOT/)


Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dapper.AOT](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dapper.AOT)

Source: [https://github.com/DapperLib/DapperAOT](https://github.com/DapperLib/DapperAOT)

</details>

### 173. [Microsoft.Windows.CsWin32](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Microsoft.Windows.CsWin32) , in the [WinAPI](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#winapi) category

Generated on : 2024-12-01 => 01 December 2024
Expand Down
2 changes: 1 addition & 1 deletion v2/Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

//if (x1.res == 2)
//{
// Console.WriteLine("asdasd");
// Console.WriteLine("asdasd");
// return;
//}
try
Expand Down
2 changes: 2 additions & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,5 @@ Nr,Key,Source,Category
170,QueryStringGenerator, https://github.com/tparviainen/query-string-generator,EnhancementClass
171,Hsu.Sg.FluentMember, https://github.com/hsu-net/source-generators,Builder
172,GoLive.Generator.BlazorInterop, https://github.com/surgicalcoder/BlazorInteropGenerator,Blazor
173,Microsoft.Windows.CsWin32, https://github.com/microsoft/CsWin32,WinAPI
174,Dapper.AOT, https://github.com/DapperLib/DapperAOT,Database
6 changes: 6 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1041,5 +1041,11 @@
"Category": 28,
"dtStart": "2024-12-01T00:00:00",
"show": true
},
{
"ID":"Dapper.AOT",
"Category": 14,
"dtStart": "2024-12-02T00:00:00",
"show": true
}
]
5 changes: 0 additions & 5 deletions v2/RSCGExamplesData/NoExample.json
Original file line number Diff line number Diff line change
Expand Up @@ -829,10 +829,5 @@
"ID":179,
"name":"Hsu.Sg.Proxy https://github.com/hsu-net/source-generators/",
"why":"later"
},
{
"ID":180,
"name":"Dapper AOT https://github.com/DapperLib/DapperAOT",
"why":"later"
}
]
71 changes: 71 additions & 0 deletions v2/book/examples/Dapper.AOT.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

<h1>RSCG nr 174 : Dapper.AOT</h1>

<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/Dapper.AOT/" target="_blank">https://www.nuget.org/packages/Dapper.AOT/</a>

<p>You can find more details at : <a href="https://aot.dapperlib.dev/" target="_blank"> https://aot.dapperlib.dev/</a></p>

<p>Author :Marc Gravell</p>

<p>Source : <a href="https://github.com/DapperLib/DapperAOT" target="_blank">https://github.com/DapperLib/DapperAOT</a> </p>

<h2>About</h2>

Generating AOT code for Dapper -hydrating classes from SQL queries.

<h2>
How to use
</h2>
<h3>
Add reference to the <a href="https://www.nuget.org/packages/Dapper.AOT/" target="_blank">Dapper.AOT</a> in the csproj
</h3>
<img src="images/Dapper.AOT/DapperDemo.csproj.png" width="580" height="580" />

<h3>This was for me the <b>starting</b> code</h3>

<br />
I have <b>coded</b> the file DapperDemo.csproj
<br />
<img src="images/Dapper.AOT/csFiles/DapperDemo.csproj.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file Program.cs
<br />
<img src="images/Dapper.AOT/csFiles/Program.cs.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file Product.cs
<br />
<img src="images/Dapper.AOT/csFiles/Product.cs.png" width="580" height="580" />
<hr />

<br />
I have <b>coded</b> the file globals.cs
<br />
<img src="images/Dapper.AOT/csFiles/globals.cs.png" width="580" height="580" />
<hr />
<h3>And here are the <i>generated</i> files</h3>

<br />
The file <i>generated</i> is DapperDemo.generated.cs
<br />
<img src="images/Dapper.AOT/generated/DapperDemo.generated.cs.png" width="580" height="580" />

<p>
You can download the code and this page as pdf from
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dapper.AOT'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dapper.AOT
</a>
</p>


<p>
You can see the whole list at
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
</a>
</p>

6 changes: 5 additions & 1 deletion v2/book/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>
<body>
<h1>
This is the list of 173 RSCG with examples =>
This is the list of 174 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -718,6 +718,10 @@ <h1>
<td>173</td>
<td><a href="examples/Microsoft.Windows.CsWin32.html">Microsoft.Windows.CsWin32</a></td>
</tr>
<tr>
<td>174</td>
<td><a href="examples/Dapper.AOT.html">Dapper.AOT</a></td>
</tr>
</table>


Expand Down
1 change: 1 addition & 0 deletions v2/book/pandocHTML.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ input-files:
- examples/Hsu.Sg.FluentMember.html
- examples/GoLive.Generator.BlazorInterop.html
- examples/Microsoft.Windows.CsWin32.html
- examples/Dapper.AOT.html

# or you may use input-file: with a single value
# defaults:
Expand Down
2 changes: 1 addition & 1 deletion v2/rscg_examples/Dapper.AOT/description.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"data":{
"goodFor":["Generating AOT code for Dapper -hydrating classes from SQL queries."],
"csprojDemo":"DapperDemo.csproj",
"csFiles":["DapperDemo.csproj","Program.cs","Product.cs","global.cs"],
"csFiles":["DapperDemo.csproj","Program.cs","Product.cs","globals.cs"],
"excludeDirectoryGenerated":[""],
"includeAdditionalFiles":[""]
},
Expand Down
1 change: 1 addition & 0 deletions v2/rscg_examples/Dapper.AOT/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Build time (AOT) tools for Dapper
8 changes: 8 additions & 0 deletions v2/rscg_examples/Dapper.AOT/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Let's face it: ADO.NET is a complicated API, and writing "good" ADO.NET code by hand is time consuming and error-prone. But a lot of times you also don't want
the ceremony of an ORM like EF or LLBLGenPro - you just want to execute SQL!

For years now, Dapper helped by providing a great low-friction way of talking to arbitrary ADO.NET databases, handling command preparation, invocation, and result parsing.

Dapper.AOT radically changes how Dapper works, generating the necessary code *during build*, and offers a range of usage guidance to improve how you use Dapper.

[Getting Started](https://aot.dapperlib.dev/gettingstarted) | [Documentation](https://aot.dapperlib.dev/)
48 changes: 48 additions & 0 deletions v2/rscg_examples/Dapper.AOT/src/.tours/Dapper.AOT.tour
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

{
"$schema": "https://aka.ms/codetour-schema",
"title": "Dapper.AOT",
"steps":
[
{
"file": "DapperDemo/DapperDemo.csproj",
"description": "First, we add Nuget [Dapper.AOT](https://www.nuget.org/packages/Dapper.AOT/) in csproj ",
"pattern": "Dapper.AOT"
}

,{
"file": "DapperDemo/globals.cs",
"description": "File globals.cs ",
"pattern": "this is the code"
}

,{
"file": "DapperDemo/Product.cs",
"description": "File Product.cs ",
"pattern": "this is the code"
}

,{
"file": "DapperDemo/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project DapperDemo/DapperDemo.csproj ",
"pattern": "this is the code"
}

,{
"file": "DapperDemo/DapperDemo.csproj",
"description": "File DapperDemo.csproj ",
"pattern": "this is the code"
}


,{
"file": "DapperDemo/obj/GX/Dapper.AOT.Analyzers/Dapper.CodeAnalysis.DapperInterceptorGenerator/DapperDemo.generated.cs",
"description": "Generated File 1 from 1 : DapperDemo.generated.cs ",
"line": 1
}

],

"ref": "main"

}
39 changes: 39 additions & 0 deletions v2/rscg_examples/Dapper.AOT/video.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"scriptName": "Dapper.AOT",
"steps":
[
{"typeStep":"exec","arg":"clipchamp.exe launch"},
{"typeStep":"text","arg": "Welcome to Roslyn Examples"},
{"typeStep":"text","arg":"If you want to see more examples , see List Of RSCG"},
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG"},
{"typeStep":"text","arg": "My name is Andrei Ignat and I am deeply fond of Roslyn Source Code Generator. "},

{"typeStep":"text","arg": "Today I will present Dapper.AOT . Generating AOT code for Dapper -hydrating classes from SQL queries. ."},
{"typeStep":"browser","arg":"https://www.nuget.org/packages/Dapper.AOT/"},
{"typeStep":"text","arg": "The whole example is here"},
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dapper.AOT"},
{"typeStep":"text","arg": "You can download the code from here"},
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dapper.AOT#download-example-net--c-"},
{"typeStep":"text","arg":"Here is the code downloaded "},
{"typeStep":"exec","arg":"explorer.exe /select,D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\Dapper.AOT\\src\\DapperDemo.sln"},
{"typeStep":"text","arg": "So , let's start the project with Visual Studio Code "},
{"typeStep":"stepvscode","arg": "-n D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\Dapper.AOT\\src"},

{"typeStep":"text","arg": "To use it ,you will put the Nuget Dapper.AOT into the csproj "},

{"typeStep":"stepvscode","arg": "-r -g D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\Dapper.AOT\\src\\DapperDemo\\DapperDemo.csproj"},

{"typeStep":"text","arg": "And now I will show you an example of using Dapper.AOT"},

{"typeStep":"hide","arg": "now execute the tour in VSCode"},
{"typeStep":"tour", "arg": "src/.tours/"},
{"typeStep":"text","arg":" And I will execute the project"},
{"typeStep":"showproj", "arg":"DapperDemo.csproj"},
{"typeStep":"text","arg":" This concludes the project"},
{"typeStep":"waitseconds","arg":"30"},
{"typeStep":"text","arg": "Remember, you can download the code from here"},
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Dapper.AOT#download-example-net--c-",
SpeakTest=" "},
{"typeStep":"waitseconds","arg":"30"},
]
}
8 changes: 5 additions & 3 deletions v2/rscg_examples_site/docs/Categories/Database.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<h1>Database</h1>

Number RSCG: 3
Number RSCG: 4

1 [Breezy](/docs/Breezy)

2 [Gedaq](/docs/Gedaq)
2 [Dapper.AOT](/docs/Dapper.AOT)

3 [TableStorage](/docs/TableStorage)
3 [Gedaq](/docs/Gedaq)

4 [TableStorage](/docs/TableStorage)

5 changes: 4 additions & 1 deletion v2/rscg_examples_site/docs/RSCG-Examples/Breezy.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,10 @@ public sealed class TableAttribute : Attribute

https://ignatandrei.github.io/RSCG_Examples/v2/docs/Breezy

### In the same category (Database) - 2 other generators
### In the same category (Database) - 3 other generators


#### [Dapper.AOT](/docs/Dapper.AOT)


#### [Gedaq](/docs/Gedaq)
Expand Down
Loading

0 comments on commit 2056259

Please sign in to comment.