



















由于新版的EntityFrameworkCore默认使用的是SqlServer2012或以上版本的Sql语法分页,来提高性能。
所以使用数据库的版本如果低于2012(如Sqlserver2008)需要显示的指定代码:
public class Startup { ... /// <summary> /// /// </summary> /// <param name="services"></param> public void ConfigureServices(IServiceCollection services) { services.AddDbContext<service.exercise.Database.SunnyTaskContext>(options => options.UseSqlServer(Configuration.GetConnectionString("SunnyTask"), b => b.UseRowNumberForPaging()));//【临时】连接老SqlServer数据库 } ... }
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。