DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
QueryEvent.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 
4 using Deveel.Data.Sql;
5 
6 namespace Deveel.Data.Diagnostics {
7  public sealed class QueryEvent : Event {
8  public QueryEvent(SqlQuery query) {
9  if (query == null)
10  throw new ArgumentNullException("query");
11 
12  Query = query;
13  }
14 
15  public SqlQuery Query { get; private set; }
16 
17  protected override void GetEventData(Dictionary<string, object> data) {
18  data["query.text"] = Query.Text;
19  data["query.paramStyle"] = Query.ParameterStyle;
20 
21  int i = 0;
22  foreach (var parameter in Query.Parameters) {
23  data[String.Format("query.param[{0}].name", i)] = parameter.Name;
24  data[String.Format("query.param[{0}].type", i)] = parameter.SqlType.ToString();
25  data[String.Format("query.param[{0}].value", i)] = parameter.Value;
26 
27  i++;
28  }
29  }
30  }
31 }
override void GetEventData(Dictionary< string, object > data)
Definition: QueryEvent.cs:17