public static void Warmup() { //EF暖机操作 using (LYMesSystemEntities dbContext = new LYMesSystemEntities()) { var objectContext = ((IObjectContextAdapter)dbContext).ObjectContext; var mappintCollection = (StorageMappingItemCollection)objectContext.MetadataWorkspace.GetItemCollection(DataSpace.CSSpace); mappintCollection.GenerateViews(new List <EdmSchemaError>()); } }
public DBService(LYMesSystemEntities DbContext) { dbContext = DbContext; }
public DBService() { dbContext = new LYMesSystemEntities(); }