-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acb59d2
commit d53663d
Showing
4 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
properties { | ||
$CurrentVersion = "3.1.1" | ||
$CurrentVersion = "3.1.2" | ||
$FullCurrentVersion = $CurrentVersion + ".0" | ||
$VisibleVersion = $CurrentVersion + "-rc2" | ||
$VisibleVersion = $CurrentVersion + "" | ||
} |
58 changes: 58 additions & 0 deletions
58
FileHelpers.Examples/Examples/10.QuickStart/70.Autoproperties.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using FileHelpers; | ||
|
||
namespace ExamplesFx | ||
{ | ||
//-> Name: Autoproperties | ||
//-> Description: You can use autoproperties instead of fields | ||
|
||
public class AutopropertiesSample | ||
: ExampleBase | ||
{ | ||
|
||
//-> If you have a source file like this, separated by a |: | ||
|
||
//-> FileIn:Input.txt | ||
/*10248|VINET|04071996|32.38 | ||
10249|TOMSP|05071996|11.61 | ||
10250|HANAS|08071996|65.83 | ||
10251|VICTE|08071996|41.34*/ | ||
//-> /FileIn | ||
|
||
|
||
//-> You can use autoproperties but for the moment you can't use Converters | ||
|
||
//-> File:RecordClass.cs | ||
[DelimitedRecord("|")] | ||
public class Orders | ||
{ | ||
public int OrderID { get; set; } | ||
|
||
public string CustomerID { get; set; } | ||
|
||
public string OrderDate { get; set; } | ||
|
||
public string Freight { get; set; } | ||
} | ||
|
||
//-> /File | ||
|
||
public override void Run() | ||
{ | ||
//-> File:Example.cs | ||
var engine = new FileHelperEngine<Orders>(); | ||
var records = engine.ReadFile("Input.txt"); | ||
|
||
foreach (var record in records) | ||
{ | ||
Console.WriteLine(record.CustomerID); | ||
Console.WriteLine(record.OrderDate); | ||
Console.WriteLine(record.Freight); | ||
} | ||
//-> /File | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters