DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Static Public Member Functions | List of all members
Deveel.Data.Diagnostics.EventExtensions Class Reference

Static Public Member Functions

static T GetData< T > (this IEvent @event, string key)
 
static string UserName (this IEvent @event)
 
static string DatabaseName (this IEvent @event)
 
static int CommitId (this IEvent @event)
 
static DateTimeOffset SessionStartTime (this IEvent @event)
 

Detailed Description

Definition at line 5 of file EventExtensions.cs.

Member Function Documentation

static int Deveel.Data.Diagnostics.EventExtensions.CommitId ( this IEvent event)
inlinestatic

Definition at line 31 of file EventExtensions.cs.

31  {
32  return @event.GetData<int>(KnownEventMetadata.CommitId);
33  }
static string Deveel.Data.Diagnostics.EventExtensions.DatabaseName ( this IEvent event)
inlinestatic

Definition at line 27 of file EventExtensions.cs.

27  {
28  return @event.GetData<string>(KnownEventMetadata.DatabaseName);
29  }
static T Deveel.Data.Diagnostics.EventExtensions.GetData< T > ( this IEvent event,
string  key 
)
inlinestatic

Definition at line 6 of file EventExtensions.cs.

6  {
7  if (@event == null || @event.EventData == null)
8  return default(T);
9 
10  object value;
11  if (!@event.EventData.TryGetValue(key, out value))
12  return default(T);
13 
14  if (value is T)
15  return (T) value;
16 
17  if (value is IConvertible)
18  return (T) Convert.ChangeType(value, typeof (T), CultureInfo.InvariantCulture);
19 
20  throw new InvalidCastException();
21  }
static DateTimeOffset Deveel.Data.Diagnostics.EventExtensions.SessionStartTime ( this IEvent event)
inlinestatic

Definition at line 35 of file EventExtensions.cs.

35  {
36  return @event.GetData<DateTimeOffset>(KnownEventMetadata.SessionStartTime);
37  }
static string Deveel.Data.Diagnostics.EventExtensions.UserName ( this IEvent event)
inlinestatic

Definition at line 23 of file EventExtensions.cs.

23  {
24  return @event.GetData<string>(KnownEventMetadata.UserName);
25  }

The documentation for this class was generated from the following file: