在我的Angularjs服务中,我有这段代码:
By.xpath("//a[text()='New']");
这是我的MVC代码,我尝试反序列化它。
$http.post(baseUrl + "Location/SaveBulk/", { "BulkPrice": run }, { cache: false });
我的BULKPRICE课程如下
<HttpPost>
Public Function SaveBulk(ByVal BulkPrice As Object) As ActionResult
Dim req As Stream = Request.InputStream
req.Seek(0, System.IO.SeekOrigin.Begin)
Dim json As String = New StreamReader(req).ReadToEnd()
req.Close()
Dim objModel As BulkPrice = Nothing
Try
objModel = JsonConvert.DeserializeObject(Of BulkPrice)(json)
'do stuff
Catch
' Try and handle malformed POST body
Return New HttpStatusCodeResult(HttpStatusCode.BadRequest)
End Try
'do stuff
Return View("Index")
End Function
InputStream正确读取数据,但DeserializeObject()没有正确反序列化。
任何帮助都会得到满足。