mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
add test code #984
This commit is contained in:
parent
3837afa0ab
commit
9ab90c4e76
@ -17,7 +17,10 @@ namespace FreeSql.Tests.Issues
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void AdoNet()
|
public void AdoNet()
|
||||||
{
|
{
|
||||||
using (var conn = g.mysql.Ado.MasterPool.Get())
|
var fsql = g.mysql;
|
||||||
|
fsql.Select<park_sys_users, park_sys_userrole>();
|
||||||
|
|
||||||
|
using (var conn = fsql.Ado.MasterPool.Get())
|
||||||
{
|
{
|
||||||
var list = conn.Value.Select<park_sys_users, park_sys_userrole>()
|
var list = conn.Value.Select<park_sys_users, park_sys_userrole>()
|
||||||
.LeftJoin((rs, le) => rs.user_id == le.ur_userid)
|
.LeftJoin((rs, le) => rs.user_id == le.ur_userid)
|
||||||
|
50
FreeSql.Tests/FreeSql.Tests/Issues/594.cs
Normal file
50
FreeSql.Tests/FreeSql.Tests/Issues/594.cs
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
using FreeSql.DataAnnotations;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace FreeSql.Tests.Issues
|
||||||
|
{
|
||||||
|
public class _594
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void Decimal()
|
||||||
|
{
|
||||||
|
var fsql = g.sqlserver;
|
||||||
|
|
||||||
|
fsql.Delete<ts_decimal_18_4>().Where("1=1").ExecuteAffrows();
|
||||||
|
var id = Guid.NewGuid();
|
||||||
|
|
||||||
|
Assert.Equal(1, fsql.Insert(new ts_decimal_18_4 { id = id }).ExecuteAffrows());
|
||||||
|
Assert.Equal(1, fsql.Update<ts_decimal_18_4>(id)
|
||||||
|
.Set(a => a.price, 698830024.6700m)
|
||||||
|
.ExecuteAffrows());
|
||||||
|
|
||||||
|
Assert.Equal(1, fsql.Update<ts_decimal_18_4>()
|
||||||
|
.SetSource(new ts_decimal_18_4 { id = id, price = 698830024.6700m })
|
||||||
|
.ExecuteAffrows());
|
||||||
|
|
||||||
|
Assert.Equal(1, fsql.Update<ts_decimal_18_4>(id).NoneParameter()
|
||||||
|
.Set(a => a.price, 698830024.6700m)
|
||||||
|
.ExecuteAffrows());
|
||||||
|
|
||||||
|
Assert.Equal(1, fsql.Update<ts_decimal_18_4>().NoneParameter()
|
||||||
|
.SetSource(new ts_decimal_18_4 { id = id, price = 698830024.6700m })
|
||||||
|
.ExecuteAffrows());
|
||||||
|
}
|
||||||
|
|
||||||
|
class ts_decimal_18_4
|
||||||
|
{
|
||||||
|
public Guid id { get; set; }
|
||||||
|
[Column(Precision = 18, Scale = 4)]
|
||||||
|
public decimal price { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user