2011-10-26 64 views

回答

1

只是類型long

public void TestNakedBigInt() 
    { 
     long foo = 12345; 
     var result = connection.Query<long>("select @foo", new {foo}).Single(); 
     foo.IsEqualTo(result); 
    } 

    public void TestBigIntMember() 
    { 
     long foo = 12345; 
     var result = connection.Query<WithBigInt>(@" 
declare @bar table(Value bigint) 
insert @bar values (@foo) 
select * from @bar", new {foo}).Single(); 
     result.Value.IsEqualTo(foo); 
    } 
    class WithBigInt 
    { 
     public long Value { get; set; } 
    } 
+0

大聲笑..我這樣做,但必須剛剛得到混淆。試了一遍,它的工作。 – jpshook