LogEntryRepository

Namespace: Babel.Data Assembly: Babel.Data.dll

A log entry repository.

public class LogEntryRepository : GenericRepository<LogEntry>, ILogEntryRepository, IGenericRepository<LogEntry>

Inheritance

objectGenericRepository<LogEntry>LogEntryRepository

Implements

ILogEntryRepository, IGenericRepository<LogEntry>

Inherited Members

GenericRepository<LogEntry>.Get(Expression<Func<LogEntry, bool>>, Func<IQueryable<LogEntry>, IOrderedQueryable<LogEntry>>, string, string, int?, int?), GenericRepository<LogEntry>.GetAsync(Expression<Func<LogEntry, bool>>, Func<IQueryable<LogEntry>, IOrderedQueryable<LogEntry>>, string, string, int?, int?, CancellationToken), GenericRepository<LogEntry>.QueryAsync(string, string, string, string, int?, int?, CancellationToken), GenericRepository<LogEntry>.GetById(params object[]), GenericRepository<LogEntry>.GetByIdAsync(params object[]), GenericRepository<LogEntry>.GetByIdAsync(object[], CancellationToken), GenericRepository<LogEntry>.CountAsync(Expression<Func<LogEntry, bool>>, CancellationToken), GenericRepository<LogEntry>.CountAsync(string, CancellationToken), GenericRepository<LogEntry>.Insert(LogEntry), GenericRepository<LogEntry>.InsertAsync(LogEntry, CancellationToken), GenericRepository<LogEntry>.Update(LogEntry), GenericRepository<LogEntry>.Delete(params object[]), GenericRepository<LogEntry>.Delete(LogEntry), GenericRepository<LogEntry>.Save(), GenericRepository<LogEntry>.SaveAsync(CancellationToken), GenericRepository<LogEntry>.DbSet, GenericRepository<LogEntry>.Context, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

LogEntryRepository(BabelDbContext)

Initializes a new instance of the LogEntryRepository class.

public LogEntryRepository(BabelDbContext context)

Parameters

NameDescription

The database context.

Methods

ConfigureAsync(LogsConfiguration)

Asynchronously configures the log.

public Task<bool> ConfigureAsync(LogsConfiguration config)

Parameters

NameDescription

The log configuration.

Returns

NameDescription

A task that represents the asynchronous configure operation result.

CountAsync(string, DateTime?, DateTime?, CancellationToken)

Asynchronously returns the number of log entries in the repository.

public virtual Task<int> CountAsync(string filter, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)

Parameters

NameDescription

filter string

Specifies the string filter.

startDate DateTime?

(Optional) The log start date.

endDate DateTime?

(Optional) The log end date.

cancellationToken CancellationToken

(Optional) A token that allows processing to be cancelled.

Returns

NameDescription

An asynchronous result that yields the number of log entries in the repository.

Delete(IEnumerable<int>)

Deletes a list of log with the given primary key values. Begins tracking the given entities in the Detached state such that they will be deleted in the database when SaveChanges() is called.

public void Delete(IEnumerable<int> logIds)

Parameters

NameDescription

The log primary key ids to delete.

GetLogEntryCountersAsync(int)

Asynchronously gets counters for the given log entry.

public Task<LogEntryCounters> GetLogEntryCountersAsync(int logId)

Parameters

NameDescription

logId int

The primary key of the log entry.

Returns

NameDescription

An asynchronous result that yields the log entry counters.

GetLogSummaryAsync(DateTime, DateTime)

Asynchronously gets a list of log summaries from this repository.

public Task<List<LogSummary>> GetLogSummaryAsync(DateTime start, DateTime end)

Parameters

NameDescription

start DateTime

Specifies a start date from which the log has been created.

Specifies an end date before which the log has been created.

Returns

NameDescription

A task that represents the asynchronous get operation.

QueryAsync(string, string, string, string, int?, int?, DateTime?, DateTime?, CancellationToken)

Asynchronously query a list of entities from this repository.

public virtual Task<List<LogEntry>> QueryAsync(string select = null, string filter = null, string orderBy = null, string includeProperties = "", int? skip = null, int? take = null, DateTime? startDate = null, DateTime? endDate = null, CancellationToken cancellationToken = default)

Parameters

NameDescription

select string

(Optional) Specifies a select expression.

filter string

(Optional) Specifies the filter expression.

orderBy string

(Optional) Order by expression.

includeProperties string

(Optional) A comma separated list of nested entity names to retrieve.

skip int?

(Optional) The number of records to skip before the first record found.

take int?

(Optional) The number of records to take after the first record found.

startDate DateTime?

(Optional) The log start date.

endDate DateTime?

(Optional) The log end date.

cancellationToken CancellationToken

(Optional) A token that allows processing to be cancelled.

Returns

NameDescription

A task that represents the asynchronous get operation.

Last updated