在寻找将所有枚举存储为数据库中的字符串的解决方案时,我想出了以下代码。
protected override void ConfigureConventions(ModelConfigurationBuilder builder)
{
builder.Properties(typeof(Enum))
.HaveConversion<string>()
.HaveColumnType("nvarchar(128)");
}
Run Code Online (Sandbox Code Playgroud)
进行一些测试,这似乎工作得很好,即使对于可为空的枚举也是如此。128 个字符的限制完全是可选的,默认值为nvarchar(max)。
由于围绕该主题的所有其他解决方案都需要更多和复杂的代码,我想知道我相当简单的方法是否有任何缺点?
我正在使用简单的按时导入将现有的SVN存储库迁移到GIT.
$ subgit import --svn-url http://svn/repo repo.git
Run Code Online (Sandbox Code Playgroud)
一切正常,但有没有机会在SubGit创建的每个GIT提交中包含相应的SVN修订号?