Class DataBaseLoggingServiceBase<T, TContext>
- Namespace
- Innova.NLogExtensions
- Assembly
- Innova.NLogExtensions.dll
Base class for database logging service.
public abstract class DataBaseLoggingServiceBase<T, TContext> : IDataBaseLoggingService where T : class where TContext : DbContext
Type Parameters
T
The type of log entity.
TContext
The type of database context.
- Inheritance
-
DataBaseLoggingServiceBase<T, TContext>
- Implements
- Derived
Constructors
- DataBaseLoggingServiceBase(IDbContextFactory<TContext>)
Initializes a new instance of the DataBaseLoggingServiceBase<T, TContext> class.
Fields
- _dbContextFactory
The database context factory.
Methods
- LogAsync(List<LogEventInfo>, CancellationToken)
Logs the list of log events asynchronously.
- Map(LogEventInfo)
Maps the log event to the log entity.
- Map(List<LogEventInfo>)
Maps the list of log events to the list of log entities.