WinJS OData JSON

后端 未结 1 884
执念已碎
执念已碎 2020-12-22 04:52

try to send data to my database by web service an get this error:

Primitive values of type \'Edm.Decimal\' and \'Edm.Int64\' must be quoted in the payload. M         


        
1条回答
  •  一整个雨季
    2020-12-22 05:48

    At least one of your properties has a declared type of Edm.Decimal or Edm.Int64. These values must be serialized as a string (i.e., the number wrapped in " characters) in OData's JSON format. If you're not sure what the declared types of the properties are, you can look up the entity type in the server's $metadata document (typically available at http://.../MyService.svc/$metadata).

    So, for the property or properties that are Edm.Int64 or Edm.Decimal, you could remove the call to parseFloat() and just keep it as a string.

    0 讨论(0)
提交回复
热议问题