Browse Source

修改追踪

zhuhao 2 years ago
parent
commit
ec2a8340c0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      IMCS_CCS/Startup.cs

+ 2 - 1
IMCS_CCS/Startup.cs

@@ -54,7 +54,8 @@ namespace IMCS.CCS
             });
             });
 
 
             //ʹÓÃmysql 
             //ʹÓÃmysql 
-            services.AddDbContext<CcsContext>(options => options.UseMySQL(Configuration.GetConnectionString("mysqlContext")));  
+            services.AddDbContext<CcsContext>(options => options.UseMySQL(Configuration.GetConnectionString("mysqlContext"))
+                                                                 .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking));  
 
 
             services.AddCors(options =>
             services.AddCors(options =>
             {
             {