VOOZH about

URL: https://www.nuget.org/packages/MeshWeaver.DataSetReader/

⇱ NuGet Gallery | MeshWeaver.DataSetReader 2.5.0




MeshWeaver.DataSetReader 2.5.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package MeshWeaver.DataSetReader --version 2.5.0
 
 
NuGet\Install-Package MeshWeaver.DataSetReader -Version 2.5.0
 
 
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="MeshWeaver.DataSetReader" Version="2.5.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MeshWeaver.DataSetReader" Version="2.5.0" />
 
Directory.Packages.props
<PackageReference Include="MeshWeaver.DataSetReader" />
 
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 MeshWeaver.DataSetReader --version 2.5.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MeshWeaver.DataSetReader, 2.5.0"
 
 
#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 MeshWeaver.DataSetReader@2.5.0
 
 
#: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=MeshWeaver.DataSetReader&version=2.5.0
 
Install as a Cake Addin
#tool nuget:?package=MeshWeaver.DataSetReader&version=2.5.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

MeshWeaver.DataSetReader

MeshWeaver.DataSetReader is a foundational library that provides base classes and abstractions for implementing data readers in the MeshWeaver ecosystem. It serves as the core framework for creating specialized data readers for various file formats.

Overview

The library provides:

  • Base classes for implementing data readers
  • Common abstractions and interfaces
  • Utility functions for data reading operations
  • Integration with MeshWeaver.DataStructures

Architecture

Core Components

Base Classes
  • Abstract reader implementations
  • Format-specific base classes
  • Common utility functions
  • Error handling infrastructure
Interfaces
  • Reader interfaces
  • Factory interfaces
  • Stream handling interfaces
  • Configuration interfaces

Supported Implementations

The framework supports multiple reader implementations, including:

Excel Readers

  • Binary format (.xls)
  • OpenXML format (.xlsx)
  • Custom properties support
  • Multi-sheet handling

CSV Reader

  • Standard CSV format
  • Custom delimiters
  • Header row handling
  • Data type inference

Usage Examples

Implementing a Custom Reader

public class CustomFormatReader : DataSetReaderBase
{
 protected override IDataSet ReadDataSetFromStream(Stream stream)
 {
 var dataSet = new DataSet();
 var table = dataSet.Tables.Add("Data");
 
 // Implement format-specific reading logic
 using (var reader = new StreamReader(stream))
 {
 // Read data and populate table
 // ...
 }
 
 return dataSet;
 }
}

Using Reader Factory Pattern

public class CustomReaderFactory : IDataSetReaderFactory
{
 public IDataSetReader CreateReader(string format)
 {
 return format.ToLower() switch
 {
 "custom" => new CustomFormatReader(),
 _ => throw new NotSupportedException($"Format {format} not supported")
 };
 }
}

Reading Data

public async Task<IDataSet> ReadDataAsync(Stream stream, string format)
{
 var factory = new CustomReaderFactory();
 var reader = factory.CreateReader(format);
 return await reader.ReadAsync(stream);
}

Extension Points

Format Support

  • Implement new format readers
  • Add custom data type handling
  • Extend configuration options
  • Add format-specific features

Data Processing

  • Custom data transformation
  • Data validation
  • Error handling
  • Progress reporting

Best Practices

  1. Error Handling

    • Implement proper error handling
    • Provide meaningful error messages
    • Handle format-specific exceptions
    • Support error recovery
  2. Performance

    • Use streaming where possible
    • Implement efficient memory usage
    • Support large file handling
    • Consider async operations
  3. Data Validation

    • Validate input format
    • Check data consistency
    • Verify column types
    • Handle missing data
  4. Configuration

    • Support flexible configuration
    • Allow format-specific options
    • Enable feature toggles
    • Provide sensible defaults

Integration

With DataStructures

public class IntegratedReader : DataSetReaderBase
{
 protected override IDataSet ReadDataSetFromStream(Stream stream)
 {
 var dataSet = new DataSet();
 // Implement reading logic that creates proper DataStructures
 return dataSet;
 }
}

With Message Hub

services.AddMessageHub(hub => hub
 .ConfigureServices(services => services
 .AddSingleton<IDataSetReaderFactory, CustomReaderFactory>()
 )
);

Testing Support

The library includes base test classes to help implement reader tests:

public class CustomReaderTests : DataSetReaderTestBase
{
 protected override void ValidateDataSet(IDataSet dataSet)
 {
 // Implement format-specific validation
 }
 
 [Fact]
 public async Task ReadsValidFile()
 {
 var reader = new CustomFormatReader();
 var result = await reader.ReadAsync(GetTestStream());
 ValidateDataSet(result);
 }
}

Related Projects

  • MeshWeaver.DataSetReader.Excel - Excel format implementation
  • MeshWeaver.DataSetReader.Csv - CSV format implementation
  • MeshWeaver.DataStructures - Core data structures
Product Versions Compatible and additional computed target framework versions.
.NET net9.0 net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on MeshWeaver.DataSetReader:

Package Downloads
MeshWeaver.DataSetReader.Excel

Package Description

MeshWeaver.DataSetReader.Csv

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-preview1 126 4/16/2026
2.5.0 265 11/3/2025
2.4.0 238 10/2/2025
2.3.0 253 8/4/2025
2.2.0 575 7/21/2025
2.1.0 251 4/6/2025
2.0.3 583 3/24/2025
2.0.2 562 3/24/2025
2.0.1 218 3/21/2025
2.0.0 240 3/20/2025
2.0.0-preview3 198 2/28/2025
2.0.0-Preview2 192 2/10/2025
2.0.0-preview1 197 1/6/2025
1.0.1 247 10/8/2024
1.0.0 208 10/8/2024