Azunt.AttachmentManagement
1.0.0
dotnet add package Azunt.AttachmentManagement --version 1.0.0
NuGet\Install-Package Azunt.AttachmentManagement -Version 1.0.0
<PackageReference Include="Azunt.AttachmentManagement" Version="1.0.0" />
<PackageVersion Include="Azunt.AttachmentManagement" Version="1.0.0" />
<PackageReference Include="Azunt.AttachmentManagement" />
paket add Azunt.AttachmentManagement --version 1.0.0
#r "nuget: Azunt.AttachmentManagement, 1.0.0"
#:package Azunt.AttachmentManagement@1.0.0
#addin nuget:?package=Azunt.AttachmentManagement&version=1.0.0
#tool nuget:?package=Azunt.AttachmentManagement&version=1.0.0
Azunt.AttachmentManagement
Azunt.AttachmentManagement is a reusable .NET 8 module for managing attachment metadata with EF Core, SQL Server, Dapper, ADO.NET, Blazor, and Open XML Excel export.
Features
- Unified
AttachmentRecordmodel - EF Core In-Memory and SQL Server support
- Dapper and ADO.NET repository implementations
- Server-side search, filtering, sorting, and paging with
PagedResult<T> - Employee, vendor, and investigation relationship metadata
- Creation and modification audit fields
- Safe creation or nullable-column enhancement of
dbo.Attachments - Optional lookup-index creation
- Blazor Server CRUD demonstration
- Excel export with the Open XML SDK
- MIT license
Audit fields
The module preserves creation metadata and records later changes separately:
CreatedAt
CreatedBy
ModifiedAt
ModifiedBy
UpdateAsync and UpdateMetadataAsync automatically set ModifiedAt to UTC. They update ModifiedBy only when a non-empty modifier is supplied. Update operations preserve CreatedAt, DateCreated, and CreatedBy so creation audit metadata remains immutable.
Install
dotnet add package Azunt.AttachmentManagement --version 1.0.0
Register in a .NET 8 MVC project using Startup.cs
using Azunt.AttachmentManagement;
public void ConfigureServices(IServiceCollection services)
{
var connectionString = Configuration.GetConnectionString("DefaultConnection")
?? throw new InvalidOperationException("DefaultConnection is not configured.");
services.AddDependencyInjectionContainerForAttachmentApp(
connectionString,
AttachmentServicesRegistrationExtensions.RepositoryMode.EfCoreSqlServer);
services.AddControllersWithViews();
}
Use RepositoryMode.Dapper or RepositoryMode.AdoNet to select another SQL Server repository.
Create or enhance the table at startup
The default operation creates the table when missing or adds only missing nullable columns. It does not create optional indexes.
public void Configure(
IApplicationBuilder app,
IWebHostEnvironment env)
{
AttachmentsTableBuilder
.RunAsync(app.ApplicationServices)
.GetAwaiter()
.GetResult();
// Remaining middleware configuration...
}
To create the recommended relationship indexes at the same time:
AttachmentsTableBuilder
.RunAsync(app.ApplicationServices, ensureIndexes: true)
.GetAwaiter()
.GetResult();
For production scale-out deployments, prefer running schema enhancement once in a deployment step or administrator process rather than from every application instance.
Direct builder usage
using var scope = app.ApplicationServices.CreateScope();
var tableBuilder = scope.ServiceProvider.GetRequiredService<AttachmentsTableBuilder>();
await tableBuilder.EnsureAsync(connectionString);
await tableBuilder.EnsureIndexesAsync(connectionString);
Pack
dotnet restore .\src\Azunt.AttachmentManagement\Azunt.AttachmentManagement\Azunt.AttachmentManagement.csproj
dotnet build .\src\Azunt.AttachmentManagement\Azunt.AttachmentManagement\Azunt.AttachmentManagement.csproj `
-c Release `
--no-restore
dotnet pack .\src\Azunt.AttachmentManagement\Azunt.AttachmentManagement\Azunt.AttachmentManagement.csproj `
-c Release `
--no-build `
-o .\artifacts
The package project is configured to create both .nupkg and .snupkg files.
Security notice
The included Azunt.Web project is a development demonstration. Add authentication, authorization, tenant isolation, request validation, secure file storage, file type and size checks, malware scanning, audit logging, and rate limiting before production deployment.
Changelog
See CHANGELOG.md for release history.
License
MIT
| 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
- Dapper (>= 2.1.79)
- DocumentFormat.OpenXml (>= 3.5.1)
- Microsoft.Data.SqlClient (>= 6.1.6)
- Microsoft.EntityFrameworkCore (>= 8.0.22)
- Microsoft.EntityFrameworkCore.InMemory (>= 8.0.22)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.22)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
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 | 349 | 7/26/2026 |
Initial public release with attachment metadata CRUD, audit fields, EF Core, Dapper, ADO.NET, SQL Server schema enhancement, Blazor demo, and Open XML Excel export.