Ver código fonte

修改追踪

zhuhao 2 anos atrás
pai
commit
ec2a8340c0
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      IMCS_CCS/Startup.cs

+ 2 - 1
IMCS_CCS/Startup.cs

@@ -54,7 +54,8 @@ namespace IMCS.CCS
             });
 
             //ʹÓÃ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 =>
             {