il.EmitCall(OpCodes.Callvirt,typeof(IDbCommand).GetMethod("CreateParameter"),null);// stack is now [parameters] [parameters] [parameter]
il.Emit(OpCodes.Dup);// stack is now [parameters] [parameters] [parameter] [parameter]
il.Emit(OpCodes.Ldstr,"@"+prop.Name);// stack is now [parameters] [parameters] [parameter] [parameter] [name]
il.Emit(OpCodes.Ldstr,prop.Name);// stack is now [parameters] [parameters] [parameter] [parameter] [name]
il.EmitCall(OpCodes.Callvirt,typeof(IDataParameter).GetProperty("ParameterName").GetSetMethod(),null);// stack is now [parameters] [parameters] [parameter]
il.Emit(OpCodes.Dup);// stack is now [parameters] [parameters] [parameter] [parameter]
vardog=connection.Query<Dog>("select '' as Extra, 1 as Age, 0.1 as Name1 , Id = @id",new{Id=guid});
vardog=connection.Query<Dog>("select '' as Extra, 1 as Age, 0.1 as Name1 , Id = @id",new{Id=guid});
dog.Count()
.IsEqualTo(1);
...
...
@@ -183,8 +189,8 @@ public void TestExpando()
publicvoidTestStringList()
{
connection.Query<string>("select * from (select 'a' as x union all select 'b' union all select 'c') as T where x in @strings",new{strings=new[]{"a","b","c"}})
.IsSequenceEqualTo(new[]{"a","b","c"});
connection.Query<string>("select * from (select 'a' as x union all select 'b' union all select 'c') as T where x in @strings",new{strings=new[]{"a","b","c"}})
.IsSequenceEqualTo(new[]{"a","b","c"});
connection.Query<string>("select * from (select 'a' as x union all select 'b' union all select 'c') as T where x in @strings",new{strings=newstring[0]})
.IsSequenceEqualTo(newstring[0]);
...
...
@@ -199,12 +205,12 @@ public void TestExecuteCommand()