YGMSExcelBeater 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package YGMSExcelBeater --version 1.0.3                
NuGet\Install-Package YGMSExcelBeater -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="YGMSExcelBeater" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YGMSExcelBeater --version 1.0.3                
#r "nuget: YGMSExcelBeater, 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.
// Install YGMSExcelBeater as a Cake Addin
#addin nuget:?package=YGMSExcelBeater&version=1.0.3

// Install YGMSExcelBeater as a Cake Tool
#tool nuget:?package=YGMSExcelBeater&version=1.0.3                

README

What is this repository for?

This class libary uses NPOI to read and write to excel file with c# .net 6 and above. It has internal mapper to map the contents of Excel sheet to a generic collection List<T> as long as the property names match the field names in the excel file. The header row must be the first row and data must start from the first column, second row

How do I get set up?

The Excel file must have a header to hold the field names. The field names must not have spaces or special characters All field names must be reproducable in the DTO where the records are mapped to

Sample setup: (Excel containing a key field in column 0 "L-2" being one of the unique values )


// Sample.xlsx is provided in the source code - just an excel file containing RecordID, Name, Title, IsActive, and DOB

string excelFileName = "C:\\Temp\\Sample.xlsx";

// Constructor takes filename, sheet number, and column number for the key, or, column name
    using (IMSExcelBeater beater = new MSExcelBeater(excelFileName, 0, 0)) // first parm: filename, second parm: sheet number. Third parm: key column number or name
         {
             string title = beater.Get("L-2", "title"); // This is to get a value from column "title" row key number "L-2"
             string result1 = beater.Update("L-2", "title", "bloon"); // This is to update the value in column "title" row key number "L-2"
             string result2 = beater.Save(); // This is to save all the updates. Remember to invoke .Save() to save your changes.

             List<TestDTO> allData = beater.GetAllData<TestDTO>(); // This is to retrieve the entire sheet into a generic collection

             string[] fieldNames = beater.GetAllFieldNames(); // This is to retreve all field names in the excel file
         }

Contribution guidelines

  • Writing tests
  • Code review
  • Other guidelines

Who do I talk to?

  • Repo owner or admin
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.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.6 75 11/7/2024
1.0.5 76 10/24/2024
1.0.4 116 10/18/2024
1.0.3 116 10/18/2024
1.0.2 112 10/18/2024
1.0.1 110 10/18/2024

Changed Namespace and included Sample.xlsx in the source code