Skip to content

Commit b1129e9

Browse files
authored
Update README.md
1 parent f4c38b8 commit b1129e9

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,38 @@
1-
# Ecia.Barcode.Parser
1+
# Ecia.Barcode.Parser
2+
`Ecia.Barcode.Parser` provides the ability to easily parse ECIA barcode strings.
3+
4+
## Install Package
5+
6+
[![NuGet](https://img.shields.io/nuget/v/Ecia.Barcode.Parser)](https://www.nuget.org/packages/Ecia.Barcode.Parser/)
7+
8+
Available on [NuGet](http://www.nuget.org/packages/Ecia.Barcode.Parser).
9+
10+
Install with the dotnet CLI: `dotnet add package Ecia.Barcode.Parser`, or through the NuGet Package Manager in Visual Studio.
11+
12+
## Usage
13+
See the [sample app](./sample/Ecia.Barcode.Parser.Sample/Program.cs) for a basic example!
14+
#### Getting an instance of the Parser
15+
16+
Dependency Injection
17+
```csharp
18+
var appBuilder = WebApplication.CreateBuilder(args);
19+
appBuilder.Services.AddTransient<IEciaBarcodeParser, EciaBarcodeParser>();
20+
```
21+
Without DI
22+
```csharp
23+
var parser = new EciaBarcodeParser();
24+
```
25+
26+
#### Parsing a Barcode string
27+
```csharp
28+
var barcodeString = "some ecia barcode string";
29+
var parser = new EciaBarcodeParser();
30+
ParsedBarcode parsedBarcode = parser.ParseBarcode(barcodeString);
31+
```
32+
33+
#### Basic ECIA compliance validation
34+
```csharp
35+
ParsedBarcode parsedBarcode = parser.ParseBarcode(barcodeString);
36+
// LabelFormat is used to determine the required identifiers. Omit or use LabelFormat.Unkown when the LabelFormat isn't known!
37+
ValidationResult validationResult = parser.ValidateParsedBarcodeCompliance(parsedBarcode, LabelFormat.PackingSlip);
38+
```

0 commit comments

Comments
 (0)