Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当前,当一列设置为 Guid(使用 AsGuid())时,它会将其创建为 VARCHAR(40)。是否有一个原因?相反,它可以更新为使用 CHAR(36) 吗?
通过创建扩展方法解决了这个问题:
public static IAlterTableColumnOptionOrAddColumnOrAlterColumnSyntax AsCustomGuid(this IAlterTableColumnAsTypeSyntax migration) { return migration.AsCustom("CHAR(36)"); }
因此,我可以使用 AsCustomGuid(),而不是使用 AsGuid()。