Aquila.ExcelReader 1.0.3

dotnet add package Aquila.ExcelReader --version 1.0.3
                    
NuGet\Install-Package Aquila.ExcelReader -Version 1.0.3
                    
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="Aquila.ExcelReader" Version="1.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aquila.ExcelReader" Version="1.0.3" />
                    
Directory.Packages.props
<PackageReference Include="Aquila.ExcelReader" />
                    
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 Aquila.ExcelReader --version 1.0.3
                    
#r "nuget: Aquila.ExcelReader, 1.0.3"
                    
#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 Aquila.ExcelReader@1.0.3
                    
#: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=Aquila.ExcelReader&version=1.0.3
                    
Install as a Cake Addin
#tool nuget:?package=Aquila.ExcelReader&version=1.0.3
                    
Install as a Cake Tool

Aquila.ExcelReader โ€” README & User Documentation

๐Ÿ“ฆ Overview

Aquila.ExcelReader is a lightweight, fluent, and developer-friendly Excel parsing library for .NET / .NET MAUI applications. It allows you to map Excel columns directly to C# models using a simple fluent API โ€” without complex configuration.

Designed for:

  • Mobile apps (MAUI)
  • Desktop apps
  • Web APIs
  • Data import tools
  • Enterprise systems

โœจ Key Features

  • Fluent column mapping
  • Header-based parsing
  • Custom value converters
  • Row validation support
  • Skip empty rows
  • Lightweight & fast
  • Async streaming read
  • Works across platforms (Windows / Android / etc.)

๐Ÿงฉ Installation

Add Package

Install via NuGet (or local reference):

dotnet add package Aquila.ExcelReader

Or add project reference if using source.


๐Ÿ“ Excel File Requirements

Your Excel sheet must:

  • Contain a header row
  • Header names must match mapped names
  • Data must begin below header row

Example Excel

itemname price
aidly 23
adosa 34
abutter 45

๐Ÿ— Step-by-Step Usage

1๏ธโƒฃ Create a Model

Define the class representing a row:

public class Item
{
    public string ItemName { get; set; }
    public decimal Price { get; set; }
}

2๏ธโƒฃ Configure Mapping

Create column mapping between Excel headers and model properties.

var map = new AqlExcelMap<Item>()
    .Map(x => x.ItemName)
        .FromHeader("itemname")
        .Build()
    .Map(x => x.Price)
        .FromHeader("price")
        .WithConverter(v => decimal.Parse(v!))
        .Build();

Mapping Options

Method Description
FromHeader() Column header name
Optional() Makes column optional
WithConverter() Custom parsing logic
Build() Finalizes column mapping

3๏ธโƒฃ Read Excel File

var options = new AqlExcelOptions
{
    HeaderRowNumber = 1,
    SkipEmptyRows = true
};

var reader = new AqlExcelReader<Item>(map, options);

using var stream = File.OpenRead("items.xlsx");
var result = await reader.ReadAsync(stream);

4๏ธโƒฃ Access Results

foreach (var item in result.Records)
{
    Console.WriteLine(item.ItemName);
    Console.WriteLine(item.Price);
}

๐Ÿ›ก Validation Example

RowValidator = obj =>
{
    var item = (Item)obj;
    return item.Price < 0
        ? "Price cannot be negative"
        : null;
}

๐Ÿ“Š Result Object

AqlExcelResult<T> provides:

Property Description
Records Parsed objects
Errors Row errors
HasErrors True if errors occurred

Example:

if(result.HasErrors)
{
    Console.WriteLine(result.Errors.Count);
}

๐Ÿงช Full Demo Service Example

public sealed class ExcelService
{
    private readonly AqlExcelMap<Item> _map;

    public ExcelService()
    {
        _map = new AqlExcelMap<Item>()
            .Map(x => x.ItemName)
                .FromHeader("itemname")
                .Build()
            .Map(x => x.Price)
                .FromHeader("price")
                .WithConverter(v => decimal.Parse(v!))
                .Build();
    }

    public async Task<AqlExcelResult<Item>> ReadExcelAsync(Stream stream)
    {
        var options = new AqlExcelOptions
        {
            HeaderRowNumber = 1,
            SkipEmptyRows = true
        };

        var reader = new AqlExcelReader<Item>(_map, options);
        return await reader.ReadAsync(stream);
    }
}

โš ๏ธ Common Mistakes

Problem Cause
0 records returned Missing .Build()
Empty data Header mismatch
Conversion crash Bad converter logic
Missing rows Wrong HeaderRowNumber

โœ… Best Practices

  • Keep headers lowercase & simple
  • Trim Excel header spaces
  • Always call .Build()
  • Validate numeric fields
  • Use converters for culture-specific parsing
  • Test mapping with small Excel files first

๐Ÿš€ Performance Tips

  • Avoid heavy converters
  • Skip validation if not needed
  • Use async streams
  • Map only required columns

๐Ÿ“Œ Platform Support

  • .NET 8 / 9
  • .NET MAUI
  • Windows
  • Android
  • iOS (supported by design)
  • macOS

๐Ÿ”ฎ Roadmap (Planned)

  • Multi-sheet reading
  • Column index mapping
  • Header fuzzy matching
  • Bulk import optimization
  • Streaming low-memory mode
  • Excel export companion

๐Ÿ‘จโ€๐Ÿ’ป Support

For issues or contributions:

  • Submit GitHub issue
  • Contact Aquila Innovations
  • Review examples in DemoExcel_App

โค๏ธ Conclusion

Aquila.ExcelReader provides a clean, modern way to import Excel data into .NET applications with minimal setup while remaining highly extensible.

Itโ€™s designed to scale from small mobile apps to enterprise-grade data pipelines.

Happy building ๐Ÿš€

Product Compatible and additional computed target framework versions.
.NET net9.0-android35.0 is compatible.  net9.0-maccatalyst18.0 is compatible.  net9.0-windows10.0.19041 is compatible.  net10.0-android was computed.  net10.0-maccatalyst 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.3 132 2/10/2026
1.0.2 120 2/10/2026
1.0.1 112 2/10/2026
1.0.0 116 2/10/2026