Skip to content

Commit d154a46

Browse files
committed
- 修复 CodeFirst IsPrimary NOT NULL 生成,sqlite 可以插入 NULL 到主键;
1 parent aa35f92 commit d154a46

File tree

3 files changed

+233
-185
lines changed

3 files changed

+233
-185
lines changed

Examples/base_entity/Program.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,16 @@ class BaseModel<T>
322322
{
323323
public static int fsql;
324324
}
325+
class StringNulable
326+
{
327+
[Column(IsPrimary = true)]
328+
public string id { get; set; }
329+
[Column(StringLength = -1, IsNullable = true)]
330+
public string code1 { get; set; }
331+
[Column(StringLength = -1, IsNullable = false)]
332+
public string code2 { get; set; }
333+
}
334+
325335

326336
static void Main(string[] args)
327337
{
@@ -379,6 +389,8 @@ static void Main(string[] args)
379389
#endregion
380390

381391

392+
var ddlsql01 = fsql.CodeFirst.GetComparisonDDLStatements<StringNulable>();
393+
382394
Expression<Func<HzyTuple<User1, Group, Group, Group, Group, Group>, bool>> where = null;
383395
where = where.Or(a => a.t6.Index > 0);
384396
where = where.Or(a => a.t5.Index > 0);

0 commit comments

Comments
 (0)