mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
修复 IsIgnore 过滤字段后,查询的错误;
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
using FreeSql.DataAnnotations;
|
||||
using FreeSql.Tests.DataContext.SqlServer;
|
||||
using System;
|
||||
using Xunit;
|
||||
|
||||
namespace FreeSql.Tests.DataAnnotations {
|
||||
@ -56,5 +57,22 @@ namespace FreeSql.Tests.DataAnnotations {
|
||||
|
||||
public string name { get; set; } = "defaultValue";
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void IsIgnore() {
|
||||
var item = new TestIsIgnore { };
|
||||
Assert.Equal(1, g.mysql.Insert<TestIsIgnore>().AppendData(item).ExecuteAffrows());
|
||||
|
||||
var find = g.mysql.Select<TestIsIgnore>().Where(a => a.id == item.id).First();
|
||||
Assert.NotNull(find);
|
||||
Assert.Equal(item.id, find.id);
|
||||
}
|
||||
|
||||
class TestIsIgnore {
|
||||
public Guid id { get; set; }
|
||||
|
||||
[Column(IsIgnore = true)]
|
||||
public bool isignore { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user