RG.CsvSerializer
2.0.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package RG.CsvSerializer --version 2.0.1
NuGet\Install-Package RG.CsvSerializer -Version 2.0.1
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="RG.CsvSerializer" Version="2.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add RG.CsvSerializer --version 2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RG.CsvSerializer, 2.0.1"
#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 RG.CsvSerializer as a Cake Addin #addin nuget:?package=RG.CsvSerializer&version=2.0.1 // Install RG.CsvSerializer as a Cake Tool #tool nuget:?package=RG.CsvSerializer&version=2.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Status: Not ready for production
Installation
Package Manager Console:
Install-Package RG.CsvSerializer
Usage
using Csv;
// Serialize collection to CSV string
string csv = CsvSerializer.Serialize(items, withHeaders: true);
// Deserialize CSV string to array
Item[] items = CsvSerializer.Deserialize<Item>(csv, hasHeaders: true);
With custom delimiter:
Item[] items = CsvSerializer.Deserialize<Item>(csv, hasHeaders: true, separator: ';');
With custom header name and date format:
class Product {
public string Name { get; set; }
[CsvColumn("Price")]
public decimal PriceBeforeTaxes { get; set; }
[CsvColumn("Added", DateFormat = "dd/MM/yyyy")]
public DateTime Added { get; set; }
}
Supported Property Types
bool
bool?
byte
byte?
sbyte
sbyte?
short
short?
ushort
ushort?
int
int?
uint
uint?
long
long?
ulong
ulong?
float
float?
double
double?
decimal
decimal?
string
DateTime
DateTime?
Uri // serialized as quoted string
Enum // serialized as unquoted string
Enum? // serialized as unquoted string
Not yet supported:
char
char?
DateTimeOffset
DateTimeOffset?
TimeSpan
TimeSpan?
Guid
Guid?
any Object to string (serialize only)
any Object to JSON
any Object to MessagePack Base64
any Object to MessagePack Hex string
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
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 |
---|---|---|
2.0.6 | 88 | 11/13/2024 |
2.0.6-preview1 | 221 | 8/8/2024 |
2.0.5 | 417 | 11/19/2023 |
2.0.4 | 151 | 11/18/2023 |
2.0.2 | 169 | 11/14/2023 |
2.0.1 | 152 | 11/13/2023 |
2.0.0 | 165 | 11/12/2023 |
1.0.10 | 1,026 | 10/10/2019 |
1.0.9 | 497 | 10/10/2019 |
1.0.8 | 525 | 10/10/2019 |
1.0.7 | 519 | 10/9/2019 |
1.0.6 | 520 | 10/9/2019 |
1.0.5 | 554 | 9/10/2019 |
1.0.4 | 539 | 9/9/2019 |
1.0.3 | 542 | 9/5/2019 |
1.0.2 | 546 | 8/24/2019 |
1.0.1 | 524 | 8/23/2019 |
1.0.0 | 547 | 8/23/2019 |