![]() |
VOOZH | about |
dotnet add package SimplyWorks.ExcelImport --version 8.1.0
NuGet\Install-Package SimplyWorks.ExcelImport -Version 8.1.0
<PackageReference Include="SimplyWorks.ExcelImport" Version="8.1.0" />
<PackageVersion Include="SimplyWorks.ExcelImport" Version="8.1.0" />Directory.Packages.props
<PackageReference Include="SimplyWorks.ExcelImport" />Project file
paket add SimplyWorks.ExcelImport --version 8.1.0
#r "nuget: SimplyWorks.ExcelImport, 8.1.0"
#:package SimplyWorks.ExcelImport@8.1.0
#addin nuget:?package=SimplyWorks.ExcelImport&version=8.1.0Install as a Cake Addin
#tool nuget:?package=SimplyWorks.ExcelImport&version=8.1.0Install as a Cake Tool
👁 Build and Publish NuGet Package
👁 NuGet
👁 NuGet Extensions
👁 License: MIT
A .NET library for reading, parsing, and validating Excel files with type-safe operations and comprehensive error handling.
This library consists of two NuGet packages:
Install the core package:
dotnet add package SimplyWorks.ExcelImport
For ASP.NET Core applications, also install the extensions package:
dotnet add package SimplyWorks.ExcelImport.Extensions
public class Order
{
[Required]
public string OrderId { get; set; }
[Required]
public string CustomerName { get; set; }
[Range(0, double.MaxValue)]
public decimal Amount { get; set; }
public DateTime OrderDate { get; set; }
}
public void ConfigureServices(IServiceCollection services)
{
services.AddExcelImport();
// Configure your DbContext
services.AddDbContext<YourDbContext>(options =>
options.UseSqlServer(connectionString));
}
public class OrderImportService
{
private readonly ExcelService _excelService;
public OrderImportService(ExcelService excelService)
{
_excelService = excelService;
}
public async Task ImportOrders(string excelFileUrl)
{
var options = new TypedParseToJsonOptions
{
TypeAssemblyQualifiedName = typeof(Order).AssemblyQualifiedName,
NamingStrategy = JsonNamingStrategy.SnakeCase
};
// Load and validate Excel file
var container = await _excelService.LoadExcelFileInfo(excelFileUrl, options);
// Check for validation errors
if (container.Sheets.Any(sheet => sheet.HasErrors()))
{
// Handle validation errors
return;
}
// Import valid data
await _excelService.Import(excelFileUrl, options);
}
}
public class OrderQueryService
{
private readonly IExcelQueryable _excelQueryable;
public OrderQueryService(IExcelQueryable excelQueryable)
{
_excelQueryable = excelQueryable;
}
public async Task<IEnumerable<Order>> GetValidOrders(string reference, int pageIndex = 0, int pageSize = 100)
{
var options = new ExcelQueryValidatedOptions
{
Reference = reference,
PageIndex = pageIndex,
PageSize = pageSize,
RowStatus = QueryRowStatus.Valid
};
return await _excelQueryable.Get<Order>(options);
}
}
Main service for importing Excel files with validation and error handling.
Interface for reading Excel files and sheets with support for:
Repository pattern implementation for storing Excel import metadata and results.
Generic sheet reader for type-safe Excel data parsing.
Built-in support for:
TypeAssemblyQualifiedName: Target type for parsingNamingStrategy: JSON naming strategy (SnakeCase, CamelCase, etc.)SheetsOptions: Configuration for multiple sheetsThe library includes Entity Framework entities for tracking:
ExcelFileRecord: Excel file metadataSheetRecord: Individual sheet informationRowRecord: Row-level data and validation resultsCellRecord: Cell-level dataBatch and BatchItem: Batch processing trackingThis project is licensed under the MIT License - see the file for details.
Please read for details on our code of conduct and the process for submitting pull requests.
For issues and questions:
This library is part of the SimplyWorks ecosystem:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 1 NuGet packages that depend on SimplyWorks.ExcelImport:
| Package | Downloads |
|---|---|
|
SimplyWorks.ExcelImport.Extensions
ASP.NET Core dependency injection extensions for SimplyWorks.ExcelImport. Provides easy service registration for Excel import functionality with Entity Framework integration. See GitHub for full documentation and examples. |
This package is not used by any popular GitHub repositories.