Lith.FlatFile 1.1.7444.21185

dotnet add package Lith.FlatFile --version 1.1.7444.21185
                    
NuGet\Install-Package Lith.FlatFile -Version 1.1.7444.21185
                    
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="Lith.FlatFile" Version="1.1.7444.21185" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lith.FlatFile" Version="1.1.7444.21185" />
                    
Directory.Packages.props
<PackageReference Include="Lith.FlatFile" />
                    
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 Lith.FlatFile --version 1.1.7444.21185
                    
#r "nuget: Lith.FlatFile, 1.1.7444.21185"
                    
#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.
#addin nuget:?package=Lith.FlatFile&version=1.1.7444.21185
                    
Install Lith.FlatFile as a Cake Addin
#tool nuget:?package=Lith.FlatFile&version=1.1.7444.21185
                    
Install Lith.FlatFile as a Cake Tool

Lith.FlatFile

This library makes it easier to consume and create flat files through tight coupling between POCO and the source or destination data.

Features

  • The specification for every file lives within it's class/model.
  • (De)Serialize most data-types including enums.
  • Objects just needs to implement the IFlatObject interface to enable usage.

How to use Lith.FlatFile

  1. Install this package ($ install-package Lith.FlatFile)
  2. Create a POCO for your file. See 'Setting up a POCO.'
  3. Read flatfile data via the LineBreaker class.
  4. Write flatfile data via the LineBuilder class.

Setting up a POCO

/// <summary>
/// Example of how a file's model has to be setup.
/// </summary>
public class ExampleFile : IFlatObject
{
	/// <summary>
	/// ID is used to match the Record/Line indicator to the Object
	/// This is required by the IFlatObject
	/// </summary>
	[FlatProperty(1, false)]
	public string ID
	{
		get
		{
			return "E";
		}
	}

	/// <summary>
	/// Example of a boolean property.
	/// 'Y' == true
	/// </summary>
	[FlatProperty(1, false, BooleanOptions = "Y|N")]
	public bool HasSomething { get; set; }

	/// <summary>
	/// Example of a enum value.
	/// Default value is OptionA or 01
	/// </summary>
	[FlatProperty(2, true, DefaultValue = DumbEnum.OptionA)]
	public DumbEnum ChosenOption { get; set; }

	/// <summary>
	/// Example of a data following 'yyyyMMdd' format
	/// </summary>
	[FlatProperty(8, false, StringFormat = "yyyyMMdd")]
	public DateTime FileDate { get; set; }

	/// <summary>
	/// Example of a record which can have a set of options.
	/// Only the PossibleValues specified are valid.
	/// </summary>
	[FlatProperty(1, false, PossibleValues = new[] { "X", "Y", "Z" })]
	public char FewOptions { get; set; }

	/// <summary>
	/// Example of a string property
	/// </summary>
	[FlatProperty(25, false)]
	public string Name { get; set; }

	/// <summary>
	/// Example of a property with decimal places
	/// 12 characters will be used before the decimal place, 3 after
	/// </summary>
	[FlatProperty(15, true, DecimalPlaces = 3)]
	public decimal Amount { get; set; }
	
	/// <summary>
	/// Indicates the maximum length for this type of Record/Line
	/// This is required by the IFlatObject
	/// </summary>
	public int TotalLineLength
	{
		get
		{
			return 75;
		}
	}
}
Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has 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
1.1.7444.21185 628 5/19/2020
1.1.7249.25790 577 11/6/2019
1.1.7249.24316 552 11/6/2019
1.1.7205.19981 569 9/23/2019
1.1.7171.37279 594 8/20/2019
1.0.7075.17286 635 5/16/2019
1.0.7058.25499 648 4/29/2019
1.0.6895.22885 785 11/17/2018
1.0.6297.30964 1,076 4/4/2017

Updated to .NET Framework 4.8