这是我的userlogincheck:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebApplication1.Models
{
public class UserLoginCheck
{
public int Id { get; set; }
public string mobile { get; set; }
public string password { get; set; }
}
}
public HttpResponseMessage PostProduct(UserLoginCheck item)
{
User user = db.Users.FirstOrDefault(x => x.Mobile == item.mobile &&
x.Password == item.password);
string uri = Url.Link("DefaultApi", new { id = item.Id });
var response = Request.CreateResponse<User>
(HttpStatusCode.Created,user);
response.Headers.Location = new Uri(uri);
return response;
}
我想发送手机和密码,并返回用户名和密码等于此用户名和密码的用户
我发现此错误:System.Net.Http.HttpRequestException:500(内部服务器错误) 我从xamarin移动应用程序中调用此方法 请帮帮我