Skip to content

Commit 5ad30cc

Browse files
committed
add TestCode #521
1 parent 9a0d2cd commit 5ad30cc

File tree

1 file changed

+48
-0
lines changed
  • FreeSql.Tests/FreeSql.Tests/Issues

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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.Text;
9+
using System.Threading;
10+
using Xunit;
11+
12+
namespace FreeSql.Tests.Issues
13+
{
14+
public class _521
15+
{
16+
[Fact]
17+
public void SelectTest()
18+
{
19+
IFreeSql fsql = g.sqlserver;
20+
fsql.Delete<ts521>().Where("1=1").ExecuteAffrows();
21+
fsql.Insert(new ts521 { ID = 1000000000000000001 }).ExecuteAffrows();
22+
23+
var item = new List<ts521>();
24+
item.Add(new ts521 { ID = 1000000000000000001, SpellCode = "ces", Version = 1 });
25+
26+
fsql.Update<ts521>().SetSource(item).UpdateColumns(info => info.SpellCode).ExecuteAffrows();
27+
}
28+
class ts521
29+
{
30+
[Key]
31+
public long ID { get; set; }
32+
33+
[Description("名字")]
34+
public string Name { get; set; }
35+
36+
[Description("账号")]
37+
[Column(IsNullable = false)]
38+
public string Account { get; set; }
39+
40+
[Description("名称拼音首字母")]
41+
public string SpellCode { get; set; }
42+
43+
[Description("乐观锁")]
44+
[Column(IsVersion = true, InsertValueSql = "1")]
45+
public long Version { get; set; }
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)