mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 优化 DbFirst 模式长内容未设置 StringLength = -1 写入问题;
This commit is contained in:
@ -11,6 +11,31 @@ namespace FreeSql.Tests.MySqlConnector
|
||||
{
|
||||
public class MySqlCodeFirstTest
|
||||
{
|
||||
[Fact]
|
||||
public void InsertUpdateParameter()
|
||||
{
|
||||
var fsql = g.mysql;
|
||||
fsql.CodeFirst.SyncStructure<ts_iupstr_bak>();
|
||||
var item = new ts_iupstr { id = Guid.NewGuid(), title = string.Join(",", Enumerable.Range(0, 2000).Select(a => "<22><><EFBFBD><EFBFBD><EFBFBD>й<EFBFBD><D0B9><EFBFBD>")) };
|
||||
Assert.Equal(1, fsql.Insert(item).ExecuteAffrows());
|
||||
var find = fsql.Select<ts_iupstr>().Where(a => a.id == item.id).First();
|
||||
Assert.NotNull(find);
|
||||
Assert.Equal(find.id, item.id);
|
||||
Assert.Equal(find.title, item.title);
|
||||
}
|
||||
[Table(Name = "ts_iupstr_bak", DisableSyncStructure = true)]
|
||||
class ts_iupstr
|
||||
{
|
||||
public Guid id { get; set; }
|
||||
public string title { get; set; }
|
||||
}
|
||||
class ts_iupstr_bak
|
||||
{
|
||||
public Guid id { get; set; }
|
||||
[Column(StringLength = -1)]
|
||||
public string title { get; set; }
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Timestamp01()
|
||||
{
|
||||
|
Reference in New Issue
Block a user