为什么streaminsight需要显式分配所有公共属性? [英] Why is streaminsight required all public properties to be explicitly assigned??
问题描述
当我创建一个简单的查询时,输出'AggregatedResult'类实例,似乎应该显式指定AggregatedResult的所有公共属性。即使是那些甚至没有设置器的只读属性。
when i create a simple query, output the 'AggregatedResult' class instance, seems all public properties of AggregatedResult should be explicitly assigned. Even those readonly properties that dont even have a setter.
不是那个已经习惯了吗?
访问我的技术博客: www.imkevinyang.com
推荐答案
首先,您实际上不应该在StreamInsight有效负载中拥有只读属性。我很惊讶自己没有引起问题...... StreamInsight不会在内部使用你的CLR类;相反,它有自己的表示,你的CLR类
提供了架构,仅此而已。这也是为什么你需要显式设置StreamInsight有效负载的值 - 你的类在运行时内不存在。
First, you really shouldn't have readonly properties in your StreamInsight payloads. I'm surprised that hasn't caused issues itself ... StreamInsight does not use your CLR classes internally; instead, it has it's own representation that your CLR classes provide the schema for, nothing more. And that's also why you need to explicitly set the values for your StreamInsight payloads - your classes don't exist inside the runtime.
所以...一旦你理解你的有效负载类如何与之交互引擎和正在发生的事情,这根本不奇怪。 ;-)
So ... once you understand how your payload classes interact with the engine and what's going on, it's not weird at all. ;-)
这篇关于为什么streaminsight需要显式分配所有公共属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!