Breeze Server for .net核心似乎无法识别OData查询字符串。
我们需要发送json。
即将邮递员与GET http://localhost:64096/breeze/Employee/Get?$ top = 5配合使用会由于OData查询字符串而引发错误。
如果需要用邮递员测试此类端点,该怎么办? 如何在邮递员上构建有效的Breeze json有效负载并将其发送到端点?
谢谢
只需下面的一些代码即可重现要使用的示例项目。
向项目中添加了一个IDesignTimeDbContextFactory类,如下所示。
编译并应用自述说明
公共类dncContextFactory:IDesignTimeDbContextFactory { 公共dncContext CreateDbContext(string [] args) { var builder = new DbContextOptionsBuilder();
builder.UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=dnc;Trusted_Connection=True;MultipleActiveResultSets=true");
return new dncContext(builder.Options);
}
}