Standardised.Vessel.Dataset
2.1.0
dotnet add package Standardised.Vessel.Dataset --version 2.1.0
NuGet\Install-Package Standardised.Vessel.Dataset -Version 2.1.0
<PackageReference Include="Standardised.Vessel.Dataset" Version="2.1.0" />
<PackageVersion Include="Standardised.Vessel.Dataset" Version="2.1.0" />
<PackageReference Include="Standardised.Vessel.Dataset" />
paket add Standardised.Vessel.Dataset --version 2.1.0
#r "nuget: Standardised.Vessel.Dataset, 2.1.0"
#:package Standardised.Vessel.Dataset@2.1.0
#addin nuget:?package=Standardised.Vessel.Dataset&version=2.1.0
#tool nuget:?package=Standardised.Vessel.Dataset&version=2.1.0
Installation
You can install the package via NuGet Package Manager Console:
Install-Package Standardised.Vessel.Dataset
Or using .NET Core CLI
dotnet add package Standardised.Vessel.Dataset
Usage
To get started with the library, you can use the following code snippet:
using StandardisedVesselDataset.Exporters.Formats.XML;
using StandardisedVesselDataset.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using SimpleExporter;
using System.Xml.Serialization;
using StandardisedVesselDataset.Models;
var builder = Host.CreateApplicationBuilder(args);
//register package DI (Dependency injection) services
builder.Services.AddSvd();
builder.Services.AddCustomValidator<ExtendedStandardisedVesselDatasetValidator>();
using var host = builder.Build();
await ExportAsync(host.Services.GetRequiredService<ISvdXmlExporter>());
await host.RunAsync();
static async Task ExportAsync(ISvdXmlExporter exporter)
{
//Load Data
var vesselReportData = LoadVesselReportData();
//Map
var svdData = MapToSvd(vesselReportData);
//Export
var reportContent = await exporter.ExportAsync(svdData);
Console.WriteLine($"Writing file to: {reportContent.FileName}");
await File.WriteAllBytesAsync(reportContent.FileName, reportContent.Content);
}
static VesselReportData LoadVesselReportData()
{
var filePath = Path.Combine("Data", "report.xml");
using var reader = new StreamReader(filePath);
var serializer = new XmlSerializer(typeof(VesselReportData));
return (VesselReportData)serializer.Deserialize(reader);
}
static StandardisedVesselDataset.Models.StandardisedVesselDataset MapToSvd(VesselReportData vesselData)
{
return new StandardisedVesselDataset.Models.StandardisedVesselDataset()
{
General = new GeneralInformation()
{
Imo = vesselData.VesselImo,
ShipName = vesselData.VesselName,
ShipReportingDate = vesselData.ReportDate,
},
PortAndRoute = new PortInformation()
{
DeparturePortCode = vesselData.DeparturePort,
DeparturePortDescription = vesselData.DeparturePortDescription,
ArrivalPortCode = vesselData.DestinationPort,
ArrivalPortDescription = vesselData.DestinationPortDescription
}
};
}
Validation
As the Standardised Vessel DataSet (SVD) model is still in its early phases, and adoption by companies may vary, we aim to be flexible with validation to accommodate different use cases. We understand that the sector might have unique requirements or variations in their data.
To provide a customizable solution, we have included an extensibility point for validation. You can easily extend our default validator and add your own rules that align with your specific needs. Below is an example of how you can create and register a custom validator:
Create your custom validator:
using StandardisedVesselDataset.Validators;
namespace StandardisedVesselDataset.Example
{
internal class ExtendedStandardisedVesselDatasetValidator : StandardisedVesselDatasetValidator
{
public ExtendedStandardisedVesselDatasetValidator()
{
//extend rules here
}
}
}
Register the validator into the DI container:
//Register
builder.Services.AddSvd();
builder.Services.AddCustomValidator<ExtendedStandardisedVesselDatasetValidator>();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- CsvHelper (>= 31.0.0)
- FluentValidation (>= 11.9.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
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 | |
|---|---|---|---|
| 2.1.0 | 211 | 6/2/2025 | |
| 2.0.0 | 194 | 5/9/2024 | |
| 1.0.0 | 194 | 4/11/2024 | |
| 0.5.0 | 183 | 4/4/2024 | |
| 0.4.0-dev-2 | 193 | 4/3/2024 | |
| 0.4.0-dev-1 | 188 | 4/3/2024 | |
| 0.4.0-dev | 198 | 4/3/2024 |