Soenneker.Blazor.SheetMapper 4.0.553

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Blazor.SheetMapper --version 4.0.553
                    
NuGet\Install-Package Soenneker.Blazor.SheetMapper -Version 4.0.553
                    
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="Soenneker.Blazor.SheetMapper" Version="4.0.553" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.SheetMapper" Version="4.0.553" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.SheetMapper" />
                    
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 Soenneker.Blazor.SheetMapper --version 4.0.553
                    
#r "nuget: Soenneker.Blazor.SheetMapper, 4.0.553"
                    
#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 Soenneker.Blazor.SheetMapper@4.0.553
                    
#: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=Soenneker.Blazor.SheetMapper&version=4.0.553
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.SheetMapper&version=4.0.553
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Blazor.SheetMapper

A Blazor upload-and-selection component for matching CSV or tab-delimited column headers to writable properties on a C# type.

SheetMapper example

Live demo

SheetMapper produces a property-to-header dictionary. It does not parse data rows, convert cell values, validate a complete mapping, or create model instances.

Installation

dotnet add package Soenneker.Blazor.SheetMapper

Register SheetMapper and its FilePond and Tom Select dependencies in Program.cs:

using Soenneker.Blazor.SheetMapper.Registrars;

builder.Services.AddSheetMapperAsScoped();

Add the component namespace to _Imports.razor:

@using Soenneker.Blazor.SheetMapper

Usage

@page "/employees/import"

<SheetMapper @ref="_mapper"
             TargetType="typeof(Employee)"
             AutomaticallyMap="true" />

<button type="button" @onclick="UseMapping">Continue</button>

@code {
    private SheetMapper? _mapper;

    private void UseMapping()
    {
        Dictionary<string, string> mapping = _mapper!.GetCurrentMap();

        // Example:
        // mapping["FirstName"] == "First Name"
        // mapping["Department"] == "" when no column was selected
    }
}

TargetType is required. The component creates one selector for each public, writable, non-indexer property. Uploading a new file replaces the current headers and mapping.

Mapping behavior

When AutomaticallyMap is enabled—or when AutoMap() is called—the mapper compares each property name with the uploaded headers:

  • comparison is case-insensitive;
  • spaces are removed from headers before the second comparison;
  • punctuation, underscores, aliases, and data annotations are not normalized;
  • multiple properties may select the same header.

Duplicate selections are marked in the UI but are not rejected. Validate the dictionary before using it if every property must map to a unique column.

GetCurrentMap() returns property names as keys and selected source headers as values. Unmapped properties have an empty-string value.

Parameters

Parameter Default Purpose
TargetType Type whose public writable properties are displayed.
AutomaticallyMap false Runs the built-in name-matching heuristic after an upload.
ShowStatusIcons true Shows mapped, unmapped, and duplicate indicators.
NotMappedIcon ⚠️ Markup used for an unmapped property.
DuplicatedIcon 🔁 Markup used when a header is selected more than once.
MappedIcon Markup used for a unique selection.

The rendered markup uses Bootstrap-style classes such as input-group, input-group-text, and form-control. Include compatible host styles or override those classes in your application. Package CSS is loaded automatically when the component becomes interactive.

Upload considerations

  • The upload is read in the browser interop path and is limited by FilePond's configured maximum stream size; the default configuration used here limits the stream to 2 MB.
  • File content is used only to discover headers. Your application remains responsible for validating the file, parsing rows, converting values, and enforcing import limits before persistence.
  • Spreadsheet formats such as .xlsx are not supported. Export them as CSV or tab-delimited text first.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
4.0.562 0 9/1/2026
4.0.561 0 9/1/2026
4.0.560 0 9/1/2026
4.0.559 0 8/31/2026
4.0.558 0 8/31/2026
4.0.557 0 8/31/2026
4.0.556 0 8/31/2026
4.0.555 29 8/31/2026
4.0.554 36 8/31/2026
4.0.553 38 8/30/2026
4.0.552 41 8/30/2026
4.0.551 35 8/29/2026
4.0.550 39 8/29/2026
4.0.549 43 8/27/2026
4.0.548 43 8/27/2026
4.0.547 57 8/26/2026
4.0.546 60 8/26/2026
4.0.545 66 8/26/2026
4.0.544 62 8/26/2026
4.0.543 95 8/22/2026
Loading failed

Update dependency Soenneker.Blazor.Utils.Ids to 4.0.25 (#1327)