使用 ASP.NET Web-Api,我的控制器中有以下 POST 设置。从 Fiddler 发布到它时,我收到错误消息:
The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities.
...当它到达 var auth = dba.ApiMembers... 行时
// POST api/Avail
[BasicAuthentication]
public HttpResponseMessage PostAvail(Avail[] avail)
{
if (ModelState.IsValid)
{
// Check if authorised
var auth = dba.ApiMembers.Where(a => a.hotel_id ==
avail[0].HID && a.UserName == User.Identity.Name)
.FirstOrDefault();
有人能看出这条线有什么问题吗?