KhatiExcel is a lightweight, high-performance C# library designed to simplify Excel file processing in .NET applications. Built for developers who need to read, parse, and work with Excel data effortlessly, KhatiExcel provides a clean API to convert Excel files into strongly-typed C# object lists using minimal configuration.
🔑 Features:
-
📄 Excel to Object Mapping — Automatically maps Excel rows to C# classes.
-
⚡ Asynchronous Support — Perform fast and responsive reads with
async/await. -
✅ Header Matching — Matches column headers to property names or custom attributes.
-
🧠 Type Conversion — Handles automatic type parsing from Excel cells to .NET types.
-
❌ No External Dependencies — Lightweight and self-contained.
-
💼 Ideal for Business Apps — Perfect for admin dashboards, data import tools, or internal apps.
Add Middleware
builder.Services.ExcelFeature();
Excel Feature
using KhatiExcel.Feature;using KhatiExcelImplementation.Model;using Microsoft.AspNetCore.Mvc;namespace KhatiExcelImplementation.Controllers{[ApiController][Route("api/[controller]/[action]")]public class ExcelFeatureController : Controller{private readonly ILoadExcel _loadExcel;public ExcelFeatureController(ILoadExcel loadExcel){_loadExcel = loadExcel;}[HttpPost]public IActionResult ReadExcel(IFormFile file){var result = _loadExcel.Fetch(file,"Sheet1");return Ok(result.data);}[HttpGet]public IActionResult ReadExcelPath(){var result = _loadExcel.Fetch("C:/Users/BS01389/Downloads/BiologyBooks.xlsx", "Sheet1");return Ok(result.data);}[HttpPost]public IActionResult SubmitBook([FromBody] List<Book> model){var result = _loadExcel.ListToExcelBase64("BookInfo",new List<string>() { "Id","Title","Price" }, model);return Ok(result.base64);}}}