看起來像沒有辦法使用edmgen做到這一點。使用反射,我發現edmgen使用System.Data.Entity.Design.dll
做它的工作,你可以&功能編程排除分貝的觀點是這樣的:
var essg = new EntityStoreSchemaGenerator("System.Data.SqlClient", ConfigurationManager.ConnectionStrings["MST"].ConnectionString, "EFModel");
essg.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 = essg.GenerateStoreMetadata(filters);
謝謝!看起來我可能是世界上想要這樣做的第四人...... – 2015-10-23 13:30:49