pvWay.ViesApi.Core 1.0.0

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

// Install pvWay.ViesApi.Core as a Cake Tool
#tool nuget:?package=pvWay.ViesApi.Core&version=1.0.0

Vies API for dotNet Core by pvWay

Tiny async service that checks a VAT number against the European Vat Number database and returns whether or not the number is valid and - when available - the name and the address of the registered company

Interfaces

IViesResult

public interface IViesResult
{
  bool Valid { get; }
  string CountryCode { get; }
  string VatNumber { get; }
  string Name { get; }
  string Address { get; }
}

IViesService

    public interface IViesService
    {
        Task<IMethodResult<IViesResult>> CheckVatAsync(
        string countryCode, string vatNumber);
    }

Dependencies

This package is using the MethodResult.Core nuGet package

Usage

using System;
using pvWay.MethodResultWrapper.Core;
using pvWay.ViesApi.Core;

namespace ViesApiConsumer.Core
{
    internal static class Program
    {
        private static void Main(/*string[] args*/)
        {
            var ls = new ConsoleLogger();
            var viesService = new ViesService(ls);
            var checkVat = viesService.CheckVatAsync("BE", "0459415853").Result;
            if (checkVat.Failure)
            {
                Console.WriteLine(checkVat.ErrorMessage);
            }
            else
            {
                var viesRes = checkVat.Data;
                Console.WriteLine(viesRes.Valid);
                Console.WriteLine(viesRes.CountryCode);
                Console.WriteLine(viesRes.VatNumber);
                Console.WriteLine(viesRes.Name);
                Console.WriteLine(viesRes.Address);
            }
        }
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.1 1,900 9/19/2020
1.0.0 507 6/20/2020

initial version