Class EventIdEnum<TDerived>
Provides a generic enumeration with implicit conversion to Microsoft.Extensions.Logging.EventId instances for use with loggers.
The value of each enum member is fixed to an int
and represents the numeric event ID. The name of the
event is automatically set to the corresponding field name.
Using the generic EventIdEnum<TDerived>, applications can define a central repository of event IDs with symbolic names and automatically generate resource informations for the Windows Event Log.
Implements
System.IComparable<TDerived>
System.Collections.Generic.IComparer<TDerived>
System.IEquatable<TDerived>
Inherited Members
Namespace: XploRe.Logging
Assembly: XploRe.Logging.dll
Syntax
public abstract class EventIdEnum<TDerived> : GenericEnum<int, TDerived>, IComparable, IComparable<TDerived>, IComparer<TDerived>, IEquatable<TDerived> where TDerived : EventIdEnum<TDerived>
Type Parameters
Name | Description |
---|---|
TDerived | Derived enum implementation type. |
Constructors
Name | Description |
---|---|
EventIdEnum(Int32) | Initialises a new EventIdEnum<TDerived> instance with the given event ID. |
Methods
Name | Description |
---|---|
ToEventId() | Returns an Microsoft.Extensions.Logging.EventId instance for the enumeration value represented by this EventIdEnum<TDerived> instance. |
Operators
Name | Description |
---|---|
Explicit(EventIdEnum<TDerived> to EventId) | Provides an implicit conversion to Microsoft.Extensions.Logging.EventId instances for use with logger facilities. |