错误信息:
System.Data.Entity.Core.EntityCommandExecutionException:“An error occurred while executing the command definition. See the inner exception for details.”
SqlException: 执行超时已过期。完成操作之前已超时或服务器未响应。
原因分析:
数据读写的时间过长,超出限制。
解决办法:
1、缩短数据读写时长。
2、增大 DbContext.Database.CommandTimeout 的值。时间单位是毫秒,默认是30秒(30000毫秒)。