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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Centeva.InterfaceRecord" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Centeva.InterfaceRecord" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Centeva.InterfaceRecord" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Centeva.InterfaceRecord --version 1.0.0
                    
#r "nuget: Centeva.InterfaceRecord, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Centeva.InterfaceRecord@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Centeva.InterfaceRecord&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Centeva.InterfaceRecord&version=1.0.0
                    
Install as a Cake Tool

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.DomainModeling
  • Centeva.DomainModeling.EFCore
  • Microsoft.Data.SqlClient
  • Microsoft.Extensions.Caching.Memory

3. Database Setup

The solution uses Entity Framework Core for persistence. The main tables are:

  • InterfaceRecord
  • InterfaceLog

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 InterfaceLog at 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 UpdateInterfaceRecordAsync method.
Querying Records
var lastSuccess = await _repository.GetLastSuccessDateAsync("MY_INTERFACE");
var records = await _repository.GetInterfaceRecordsAsync();

5. Customization

  • Use the InterfaceRecordTypeAttribute to annotate methods with interface record type names.
  • Extend or implement IInterfaceRecordRepository for 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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