Last active
February 20, 2016 01:09
-
-
Save NickCraver/d4c8f8f00eb948a97763 to your computer and use it in GitHub Desktop.
How to be a jerk using SQL and Dapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tb = AppDomain.CurrentDomain | |
.DefineDynamicAssembly(new AssemblyName("Test"), AssemblyBuilderAccess.Run) | |
.DefineDynamicModule("DM") | |
.DefineType("Type with spaces in the name", TypeAttributes.Public); | |
tb.DefineField("Is💩Post", typeof(bool), FieldAttributes.Public); | |
var spt = tb.CreateType(); | |
this.Connection.QueryFirstOrDefault(spt, "Select 1 as [Is💩Post]").Dump(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Query Kind="Statements"> | |
<Connection> | |
<ID>c4ca2c63-939c-44ca-a154-2d7e1f9db2a7</ID> | |
<Persist>true</Persist> | |
<Server>.</Server> | |
<Database>tempdb</Database> | |
<ShowServer>true</ShowServer> | |
</Connection> | |
<NuGetReference Prerelease="true">Dapper</NuGetReference> | |
<Namespace>Dapper</Namespace> | |
<Namespace>System.Reflection.Emit</Namespace> | |
</Query> | |
var tb = AppDomain.CurrentDomain | |
.DefineDynamicAssembly(new AssemblyName("Test"), AssemblyBuilderAccess.Run) | |
.DefineDynamicModule("DM") | |
.DefineType("Type with spaces in the name", TypeAttributes.Public); | |
tb.DefineField("Is💩Post", typeof(bool), FieldAttributes.Public); | |
var spt = tb.CreateType(); | |
this.Connection.QueryFirstOrDefault(spt, "Select 1 as [Is💩Post]").Dump(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment