|
| 1 | +using FreeSql.DataAnnotations; |
| 2 | +using Newtonsoft.Json; |
| 3 | +using System; |
| 4 | +using System.Collections.Generic; |
| 5 | +using System.ComponentModel; |
| 6 | +using System.ComponentModel.DataAnnotations; |
| 7 | +using System.Diagnostics; |
| 8 | +using System.Reflection; |
| 9 | +using System.Text; |
| 10 | +using System.Threading; |
| 11 | +using Xunit; |
| 12 | + |
| 13 | +namespace FreeSql.Tests.Issues |
| 14 | +{ |
| 15 | + public class _594 |
| 16 | + { |
| 17 | + [Fact] |
| 18 | + public void Decimal() |
| 19 | + { |
| 20 | + var fsql = g.sqlserver; |
| 21 | + |
| 22 | + fsql.Delete<ts_decimal_18_4>().Where("1=1").ExecuteAffrows(); |
| 23 | + var id = Guid.NewGuid(); |
| 24 | + |
| 25 | + Assert.Equal(1, fsql.Insert(new ts_decimal_18_4 { id = id }).ExecuteAffrows()); |
| 26 | + Assert.Equal(1, fsql.Update<ts_decimal_18_4>(id) |
| 27 | + .Set(a => a.price, 698830024.6700m) |
| 28 | + .ExecuteAffrows()); |
| 29 | + |
| 30 | + Assert.Equal(1, fsql.Update<ts_decimal_18_4>() |
| 31 | + .SetSource(new ts_decimal_18_4 { id = id, price = 698830024.6700m }) |
| 32 | + .ExecuteAffrows()); |
| 33 | + |
| 34 | + Assert.Equal(1, fsql.Update<ts_decimal_18_4>(id).NoneParameter() |
| 35 | + .Set(a => a.price, 698830024.6700m) |
| 36 | + .ExecuteAffrows()); |
| 37 | + |
| 38 | + Assert.Equal(1, fsql.Update<ts_decimal_18_4>().NoneParameter() |
| 39 | + .SetSource(new ts_decimal_18_4 { id = id, price = 698830024.6700m }) |
| 40 | + .ExecuteAffrows()); |
| 41 | + } |
| 42 | + |
| 43 | + class ts_decimal_18_4 |
| 44 | + { |
| 45 | + public Guid id { get; set; } |
| 46 | + [Column(Precision = 18, Scale = 4)] |
| 47 | + public decimal price { get; set; } |
| 48 | + } |
| 49 | + } |
| 50 | +} |
0 commit comments