标签:init error space gen 情况 collect start ati color
1.Code First第一次启动会对比程序中的Model与数据库表(database initializer ),生成Model与数据库的映射视图。使用ef6的情况下,在Application_Start里面添加
using (var dbcontext = new NCContext()) { var objectContext = ((IObjectContextAdapter)dbcontext).ObjectContext; var mappingCollection = (StorageMappingItemCollection)objectContext.MetadataWorkspace.GetItemCollection(DataSpace.CSSpace); mappingCollection.GenerateViews(new List<EdmSchemaError>()); }
标签:init error space gen 情况 collect start ati color
原文地址:https://www.cnblogs.com/shuajing/p/EF.html