我一直试图将空的SQL 2012数据库反向工程为代码。我从实体框架电动工具中获取代码以进行逆向工程。我注意到,当我运行电动工具或运行下面的代码时,生成商店模式需要2个多小时。
数据库是否有问题,或者它本身就很慢?
EntityStoreSchemaGenerator entityStoreSchemaGenerator = new EntityStoreSchemaGenerator(provider, "Data Source=.;Initial Catalog=InSysV5;Integrated Security=True", "dbo")
{
GenerateForeignKeyProperties = true
};
entityStoreSchemaGenerator.GenerateForeignKeyProperties = true;
var filter1 = new EntityStoreSchemaFilterEntry(null, null, null, EntityStoreSchemaFilterObjectTypes.Table, EntityStoreSchemaFilterEffect.Allow);
var filter2 = new EntityStoreSchemaFilterEntry(null, null, null, EntityStoreSchemaFilterObjectTypes.View, EntityStoreSchemaFilterEffect.Exclude);
var filter3 = new EntityStoreSchemaFilterEntry(null, null, null, EntityStoreSchemaFilterObjectTypes.Function, EntityStoreSchemaFilterEffect.Exclude);
var filters = new EntityStoreSchemaFilterEntry[] { filter1, filter2, filter3 };
var errors1 = entityStoreSchemaGenerator.GenerateStoreMetadata(filters);