Skip to content

Commit

Permalink
docs: add package README's (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
skwasjer authored Nov 14, 2021
1 parent b58693d commit 02c98de
Show file tree
Hide file tree
Showing 11 changed files with 220 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# IbanNet <img align="right" width="64" height="64" src="IbanNet64.png">

IbanNet is a .NET library providing functionality to validate and parse an [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) also known as IBAN.
IbanNet is a .NET library providing functionality to validate and parse an [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) also known as IBAN.

Additionally, IbanNet provides:
- the `Iban` primitive type, which can be used as a drop in replacement for a `string` in your domain.
- a builder to construct IBAN's from a Basic Bank Account Number (BBAN).
- a generator to assist with (unit) testing.

---

Expand Down
5 changes: 5 additions & 0 deletions src/IbanNet.DataAnnotations/IbanNet.DataAnnotations.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
<Description>Data annotations to validate IBAN user input.</Description>
<PackageProjectUrl>https://github.com/skwasjer/IbanNet/wiki/IbanNet.DataAnnotations</PackageProjectUrl>
<PackageTags>IBAN, International Bank Account Number, Web API, MVC</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" Condition="'$(TargetFramework)'!='net5.0' And '$(TargetFramework)'!='net6.0'" />
</ItemGroup>
Expand Down
35 changes: 35 additions & 0 deletions src/IbanNet.DataAnnotations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
`IbanNet.DataAnnotations` provides an attribute allowing validation of IBAN user input with ASP.NET (Core) and Microsoft Data Annotations.

## Example

```csharp
public class InputModel
{
[Iban]
[Required]
public string BackAccountNumber { get; set; }
}

[ApiController]
public class MyController : ControllerBase
{
[HttpPost]
public ActionResult Save(InputModel model)
{
if (ModelState.IsValid)
{
// ..
}
}
}
```

## Other info

- [Changelog](https://github.com/skwasjer/IbanNet/blob/master/CHANGELOG.md)
- [IbanNet supported countries](https://github.com/skwasjer/IbanNet/blob/master/SupportedCountries.md)
- [Fiddle](https://dotnetfiddle.net/JeGa9x)

### Contributions

Please check out the [contribution guidelines](https://github.com/skwasjer/IbanNet/blob/master/CONTRIBUTING.md).
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
<Description>Autofac IoC container integration for IbanNet; IbanNet provides an IBAN validator and parser.</Description>
<PackageProjectUrl>https://github.com/skwasjer/IbanNet/wiki/Dependency-injection</PackageProjectUrl>
<PackageTags>IBAN, IoC, Autofac, IbanNet, dependencyinjection</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="6.2.0" />
</ItemGroup>
Expand Down
37 changes: 37 additions & 0 deletions src/IbanNet.DependencyInjection.Autofac/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Autofac IoC container integration for IbanNet; [IbanNet](https://github.com/skwasjer/IbanNet) provides an IBAN validator and parser.

## Available services

This library registers the following services:

- `IIbanValidator`
- `IIbanGenerator`
- `IIbanParser`

## Example

Register IbanNet services:

```csharp
container.RegisterIbanNet();
```

Or register IbanNet services with configuration:

```csharp
container
.RegisterIbanNet(opts => opts
.UseRegistryProvider(new SwiftRegistryProvider())
.WithRule<MyCustomRule>()
);
```

## Other info

- [Changelog](https://github.com/skwasjer/IbanNet/blob/master/CHANGELOG.md)
- [IbanNet supported countries](https://github.com/skwasjer/IbanNet/blob/master/SupportedCountries.md)
- [Fiddle](https://dotnetfiddle.net/JeGa9x)

### Contributions

Please check out the [contribution guidelines](https://github.com/skwasjer/IbanNet/blob/master/CONTRIBUTING.md).
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
<Description>Microsoft.Extensions.DependencyInjection integration for IbanNet; IbanNet provides an IBAN validator and parser.</Description>
<PackageProjectUrl>https://github.com/skwasjer/IbanNet/wiki/Dependency-injection</PackageProjectUrl>
<PackageTags>IBAN, IbanNet, IoC, dependencyinjection, di, servicecollection, serviceprovider</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(MicrosoftExtensionsVersion)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(MicrosoftExtensionsVersion)" />
Expand Down
37 changes: 37 additions & 0 deletions src/IbanNet.DependencyInjection.ServiceProvider/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
`Microsoft.Extensions.DependencyInjection` integration for IbanNet; [IbanNet](https://github.com/skwasjer/IbanNet) provides an IBAN validator and parser.

## Available services

This library registers the following services:

- `IIbanValidator`
- `IIbanGenerator`
- `IIbanParser`

## Example

Add IbanNet services:

```csharp
services.AddIbanNet();
```

Or add IbanNet services with configuration:

```csharp
services
.AddIbanNet(opts => opts
.UseRegistryProvider(new SwiftRegistryProvider())
.WithRule<MyCustomRule>()
);
```

## Other info

- [Changelog](https://github.com/skwasjer/IbanNet/blob/master/CHANGELOG.md)
- [IbanNet supported countries](https://github.com/skwasjer/IbanNet/blob/master/SupportedCountries.md)
- [Fiddle](https://dotnetfiddle.net/JeGa9x)

### Contributions

Please check out the [contribution guidelines](https://github.com/skwasjer/IbanNet/blob/master/CONTRIBUTING.md).
5 changes: 5 additions & 0 deletions src/IbanNet.FluentValidation/IbanNet.FluentValidation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
<Description>FluentValidation support to validate IBAN user input.</Description>
<PackageProjectUrl>https://github.com/skwasjer/IbanNet/wiki/IbanNet.FluentValidation</PackageProjectUrl>
<PackageTags>IBAN, International Bank Account Number, FluentValidation, Web API, MVC</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="FluentValidation" Version="10.2.3" />
</ItemGroup>
Expand Down
41 changes: 41 additions & 0 deletions src/IbanNet.FluentValidation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FluentValidation support to validate IBAN user input.

## Example

Create a rule for a property and call the `Iban(IIbanValidator)` extension method to enable the validator.

```csharp
public class InputModel
{
public string BackAccountNumber { get; set; }
}

public class InputModelValidator : AbstractValidator<InputModel>
{
public InputModelValidator(IIbanValidator ibanValidator)
{
RuleFor(x => x.BankAccountNumber).NotNull().Iban(ibanValidator);
}
}
```

Prerequisite service registration (.NET Core) of IbanNet.

```csharp
services.AddIbanNet();
services.AddTransient<IValidator<InputModel>, InputModelValidator>()
services.AddFluentValidation();
```

For more information on how to register FluentValidation and custom abstract validators:
https://docs.fluentvalidation.net/en/latest/aspnet.html

## Other info

- [Changelog](https://github.com/skwasjer/IbanNet/blob/master/CHANGELOG.md)
- [IbanNet supported countries](https://github.com/skwasjer/IbanNet/blob/master/SupportedCountries.md)
- [Fiddle](https://dotnetfiddle.net/JeGa9x)

### Contributions

Please check out the [contribution guidelines](https://github.com/skwasjer/IbanNet/blob/master/CONTRIBUTING.md).
5 changes: 5 additions & 0 deletions src/IbanNet/IbanNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
<Description>Provides a strict International Bank Account Number (IBAN) validator, parser, builder, generator and the Iban primitive type.</Description>
<PackageProjectUrl>https://github.com/skwasjer/IbanNet/wiki</PackageProjectUrl>
<PackageTags>IBAN, International Bank Account Number</PackageTags>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
Expand Down
39 changes: 39 additions & 0 deletions src/IbanNet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
IbanNet is a .NET library providing functionality to validate and parse an [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) also known as IBAN.

Additionally, IbanNet provides:
- the `Iban` primitive type, which can be used as a drop in replacement for a `string` in your domain.
- a builder to construct IBAN's from a Basic Bank Account Number (BBAN).
- a generator to assist with (unit) testing.

## Example with validator

```csharp
IIbanValidator validator = new IbanValidator();
ValidationResult validationResult = validator.Validate("NL91 ABNA 0417 1643 00");
if (validationResult.IsValid)
{
// ..
}
```

## Example with `Iban` type

```csharp
Iban iban;
IIbanParser parser = new IbanParser(IbanRegistry.Default);
bool success = parser.TryParse("NL91 ABNA 0417 1643 00", out iban);
if (success)
{
Console.WriteLine(iban.ToString(IbanFormat.Obfuscated)); // XXXXXXXXXXXXXX4300
}
```

## Other info

- [Changelog](https://github.com/skwasjer/IbanNet/blob/master/CHANGELOG.md)
- [IbanNet supported countries](https://github.com/skwasjer/IbanNet/blob/master/SupportedCountries.md)
- [Fiddle](https://dotnetfiddle.net/JeGa9x)

### Contributions

Please check out the [contribution guidelines](https://github.com/skwasjer/IbanNet/blob/master/CONTRIBUTING.md).

0 comments on commit 02c98de

Please sign in to comment.