I'm trying to write some simple Extended Events management code in C#, but am fairly new to it. I am able to setup XEvent sessions in SSMS and was able to get the Linq stream from that created session in C# using this example
What I would like to do now, is to be able to query a given database for what sessions exist. I could manually query the sys.dm_xe*
tables and create the mapped classes for those, but it looks like the classes already exist in the Microsoft.SqlServer.Management.XEvent namespace - so I'd hate to do a poor re-implementation if something already exists.
The specific table holding what sessions exist is sys.dm_xe_sessions
.
Any example code or help is appreciated. Thanks!