Centeva.InterfaceRecord
1.0.0
Prefix Reserved
dotnet add package Centeva.InterfaceRecord --version 1.0.0
NuGet\Install-Package Centeva.InterfaceRecord -Version 1.0.0
<PackageReference Include="Centeva.InterfaceRecord" Version="1.0.0" />
<PackageVersion Include="Centeva.InterfaceRecord" Version="1.0.0" />
<PackageReference Include="Centeva.InterfaceRecord" />
paket add Centeva.InterfaceRecord --version 1.0.0
#r "nuget: Centeva.InterfaceRecord, 1.0.0"
#:package Centeva.InterfaceRecord@1.0.0
#addin nuget:?package=Centeva.InterfaceRecord&version=1.0.0
#tool nuget:?package=Centeva.InterfaceRecord&version=1.0.0
Centeva.InterfaceRecord
Centeva.InterfaceRecord provides a standardized way to track and manage Hangfire execution records within .NET applications. It is designed to help consuming applications record Hangfire job runs, their success/failure, and related metadata for auditing and operational purposes.
Features
- Track Hangfire job execution status, errors, and notes.
- Log start/end times and success state for each job run.
- Query last successful run and all job execution records.
- Entity Framework Core configuration for persistence.
- Extensible via repository interface.
Getting Started
1. Installation
Add a reference to the Centeva.InterfaceRecord project or NuGet package in your application.
2. Dependencies
Ensure your project targets .NET 8.0 or higher and includes the following packages:
Centeva.DomainModelingCenteva.DomainModeling.EFCoreMicrosoft.Data.SqlClientMicrosoft.Extensions.Caching.Memory
3. Database Setup
The solution uses Entity Framework Core for persistence. The main tables are:
InterfaceRecordInterfaceLog
Your application's DbContext must include the following sets to enable tracking and querying:
public DbSet<InterfaceRecord> InterfaceRecords { get; set; }
public DbSet<InterfaceLog> InterfaceLogs { get; set; }
Configure your DbContext to include the provided InterfaceLogConfiguration for table mapping:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ApplyConfiguration(new InterfaceLogConfiguration());
// ... other configurations
}
4. Usage
Real-World Example: Logging an Hangfire Job Run
Below is a simple example from Dashboard.Data.DataAccess.InspectionsSyncRepository.cs showing how to use InterfaceLog and the repository to record a Hangfire job run:
public async Task SendAdamsLERsToInspectionsAsync(string code) {
var r = new InterfaceLog(code);
try
{
// ... business logic to send LERs ...
r.Success = true;
}
catch(Exception ex)
{
r.ErrorMessage += ex.ToString();
}
finally
{
r.Complete();
await _interfaceRecordRepo.UpdateInterfaceRecordAsync(r);
}
}
Key points:
- Create an
InterfaceLogat the start of your process. - Update its properties (
Success,Notes,ErrorMessage) as your logic executes. - Call
.Complete()before saving. - Persist the log using your repository's
UpdateInterfaceRecordAsyncmethod.
Querying Records
var lastSuccess = await _repository.GetLastSuccessDateAsync("MY_INTERFACE");
var records = await _repository.GetInterfaceRecordsAsync();
5. Customization
- Use the
InterfaceRecordTypeAttributeto annotate methods with interface record type names. - Extend or implement
IInterfaceRecordRepositoryfor custom data access logic.
Exception Handling
InterfaceRecordException is thrown for failures during record updates.
Contributing
- Ensure code follows .NET 8+ standards.
- Add tests for new features.
- Submit pull requests via your repository workflow.
License
See repository for license details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Centeva.DomainModeling (>= 10.2.0)
- Centeva.DomainModeling.EFCore (>= 10.2.0)
- Microsoft.Data.SqlClient (>= 6.1.2)
- Microsoft.Extensions.Caching.Memory (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 440 | 11/19/2025 |