Lith.FlatFile 1.1.7205.19981

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

// Install Lith.FlatFile as a Cake Tool
#tool nuget:?package=Lith.FlatFile&version=1.1.7205.19981

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 net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  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 549 5/19/2020
1.1.7249.25790 521 11/6/2019
1.1.7249.24316 498 11/6/2019
1.1.7205.19981 516 9/23/2019
1.1.7171.37279 535 8/20/2019
1.0.7075.17286 568 5/16/2019
1.0.7058.25499 588 4/29/2019
1.0.6895.22885 708 11/17/2018
1.0.6297.30964 962 4/4/2017

String Fields can now be populated with values that are shorter than specified.