Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'Newtonsoft.Json.Linq.JArray'

前端 未结 3 1832
-上瘾入骨i
-上瘾入骨i 2020-12-17 09:46

I am testing my Web API. Mocking the data I have this:

var objs = ((JArray)JsonConvert.DeserializeObject(\"{ \\\"PrintId\\\":10,\\\"Header\\\":\\\"header\\\"         


        
3条回答
  •  猫巷女王i
    2020-12-17 10:08

    For me I was putting empty string as an object which caused the issue, I switched to "{}" which fixed my issue

提交回复
热议问题