问题描述
客户端的内容:privateasyncvoidButton_Click_1(objectsender,System.Windows.RoutedEventArgse){stringusername=TextBox.Text.Trim();stringpwd=PasswordBox.Password.Trim();if(username==""||pwd==""){MessageBox.Show("用户名或密码不能为空!");}student2s=newstudent2();s.username=username;s.pwd=pwd;stringresult=JsonConvert.SerializeObject(s);HttpClientclient=newHttpClient();HttpResponseMessagemessage=awaitclient.PostAsync("http://localhost:64102/api/Log",newStringContent(result));if(message.IsSuccessStatusCode){stringresultContent=awaitmessage.Content.ReadAsStringAsync();student2sResult=JsonConvert.DeserializeObject<student2>(resultContent);}}web服务端要响应客户端的内容并返回要怎么写?新手求助,谢谢[HttpPost]publicHttpResponseMessageLogin([FromBody]IEnumerable<student2>){}publicIEnumerable<student2>GetLog(stringusername,stringpwd){using(dbEntitiest=newdbEntities()){ResponseData<student2>responseSuccessData=t.student2.Where(l=>l.username==usernameandl.pwd==pwd);returnt.student2.AsQueryable().ToList();}}