c# nullable double 通过氟网关到actionscript NaN
氟中是否有办法强制将可空双精度值作为 NaN 传递给 flex ? (反之亦然) 默认情况下,这些值作为 null 传递,但 actionscript 中的 Number 不可为 null,因此默认情况下将其转换为 0。
我需要服务器端可空双精度数在 Flex 中为 NaN,并且 Flex 中的 NaN 值在服务器端为可空双精度数。
有什么想法吗?
谢谢,
Is there a way in fluorine to force a nullable double to be passed to flex as NaN? (and vice versa)
By default these values are passed as null, but a Number in actionscript is not nullable, so it is converted to 0 by default.
I need server side nullable doubles to be NaN in flex, and NaN values from flex to be nullable doubles on the server side.
Any thoughts?
Thx,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道氟,但我想你可以传入:
This expression is of type
double
, notdouble?
, and it will be NaN if <代码>myDouble 为null
。I don't know Fluorine, but I'd imagine that you could pass in:
This expression is of type
double
, notdouble?
, and it will be NaN ifmyDouble
wasnull
.我们刚刚遇到了同样的问题。我们的解决方案是修改 Fluorine 代码来编写对象。
在文件
AMFWriter
的1367
行中,在调用WriteAMF3Data(memberValue)
之前,我添加了以下代码:到目前为止,它似乎有效。但是,我通常不使用 .NET 编写代码,因此可能有更好的方法来执行此操作。
We just had the same problem. Our solution was to modify the Fluorine code for writing objects.
In the file
AMFWriter
, line1367
, right before callingWriteAMF3Data(memberValue)
I added the following code:It seems to work so far. But, I don't usually code in .NET, so there might be a better way of doing this.
看起来 fluine 有一个配置部分,它定义了如何转换可空值。我还没有测试过。
复制自
It looks like fluorine has a config section which defines how nullables are converted. I haven't tested it yet.
Copied from
http://www.fluorinefx.com/docs/fluorine/nullable.html