Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/302.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# StreamInsight中Linq的使用_C#_Sql Server_Linq_Streaminsight - Fatal编程技术网

C# StreamInsight中Linq的使用

C# StreamInsight中Linq的使用,c#,sql-server,linq,streaminsight,C#,Sql Server,Linq,Streaminsight,在StreamInsight中,许多示例介绍了 流的计数、总和、过滤器 var cepStream = enumerable.ToPointStream(application, e => PointEvent<Car>.CreateInsert(new DateTimeOffset(e.TimeStamp, TimeSpan.Zero), e), AdvanceTimeSettings.IncreasingStartTime); var step1 = from e in

在StreamInsight中,许多示例介绍了 流的计数、总和、过滤器

var cepStream = enumerable.ToPointStream(application, e =>  PointEvent<Car>.CreateInsert(new DateTimeOffset(e.TimeStamp, TimeSpan.Zero), e), AdvanceTimeSettings.IncreasingStartTime);

var step1 = from e in cepStream
                    where e.Color == "RedCar"
                    select e;
var cepStream=enumerable.ToPointStream(应用程序,e=>PointEvent.CreateInsert(新的日期时间偏移量(e.TimeStamp,TimeSpan.Zero),e),AdvanceTimeSettings.IncreasingStartTime);
var step1=来自cepStream中的e
其中e.Color==“红色汽车”
选择e;
定义提取在中发生的记录的查询有一些困难 一定的时间长度。例如,step1存储的点事件为“RedCar”, 但如何提取10分钟内连续发生的两个“红色汽车”事件


真的被困在这里了,非常感谢您的帮助

要确定两个事件是否在彼此的某个时间内发生,我们必须操纵它们的事件生存期,以便它们同时有效。我们可以通过使用联接来确定两个事件是否同时有效

  • 将步骤1的事件时间转换为步骤2

    var step2=步骤1中的e。移动时间间隔(e=>TimeSpan.FromMinutes(10))选择e

  • 将步骤1的事件持续时间更改为步骤3

    var step3=步骤1中的e。AlterEventDuration(e=>TimeSpan.FromMinutes(10))选择e

  • 将步骤2和步骤3合并为步骤4

    var step4=第2步中的l,在第3步中的l上加入r等于r,选择l


  • 这有帮助吗?

    嗨,TXPower275,这对我很有帮助。只是想知道检查快照窗口(PointEvents)的endTime startTime是否更常见、更容易?这取决于您正在做什么,但根据您最初提出的要求,我认为这不会有什么帮助。快照窗口是根据流中事件的开始和结束时间定义的,而不是沿时间轴的固定网格。通过使用快照窗口,我可以计算时间差=结束时间开始时间,并检查该值是否小于10分钟。如果我错了,请指出。如果您不想使用StreamInsight事件处理引擎,可以使用UDO或UDSO按程序执行。在处理事件开始和结束时间时,我倾向于使用事件处理引擎。我有很多类似于SI LINQ的“HowTo”问题。我在哪里可以找到更多的LINQ示例和热点以获得解决问题的技能?我四处搜索,只找到了几个例子和文档。亚马逊上还没有关于SI的书籍出售。