开发者

How To Disable Subsonic's Primary Key Autoincrement?

I'm using Subsonic (simplerepository) and SQLite, and I have a class with an Int64 property marked as [SubSonicPrimaryKey]:

[SubSonicPrimaryKey]    
public Int64 MyID;
开发者_开发百科

which is transformed into:

[MyID] integer NOT NULL PRIMARY KEY AUTOINCREMENT

Is it possible to disable the AUTOINCREMENT feature?


Well, I found it by myself. Autoincrement feature is automatic and cannot be switched off. Here's what the code does:

        if(column.IsPrimaryKey)
        {
            sb.Append(" NOT NULL PRIMARY KEY");
            if(column.IsNumeric)
                sb.Append(" AUTOINCREMENT ");
        }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜