NPKTools.Optimizer.PpmTargetParser
1.0.4
dotnet add package NPKTools.Optimizer.PpmTargetParser --version 1.0.4
NuGet\Install-Package NPKTools.Optimizer.PpmTargetParser -Version 1.0.4
<PackageReference Include="NPKTools.Optimizer.PpmTargetParser" Version="1.0.4" />
paket add NPKTools.Optimizer.PpmTargetParser --version 1.0.4
#r "nuget: NPKTools.Optimizer.PpmTargetParser, 1.0.4"
// Install NPKTools.Optimizer.PpmTargetParser as a Cake Addin #addin nuget:?package=NPKTools.Optimizer.PpmTargetParser&version=1.0.4 // Install NPKTools.Optimizer.PpmTargetParser as a Cake Tool #tool nuget:?package=NPKTools.Optimizer.PpmTargetParser&version=1.0.4
NPKTools.Optimizer.PpmTargetParser
The NPKTools.Optimizer.PpmTargetParser project is designed as a specialized component within the NPKTools suite, aimed at interpreting and transforming user input into actionable data models. This project primarily focuses on parsing strings that represent the concentration of various elements in parts per million (ppm) and converting them into structured PpmTarget objects which can be further processed or analyzed within the system.
Developers
This tool was developed by Anatoliy Yermakov.
- LinkedIn: Anatoliy Yermakov
- GitHub: i7aket
Special thanks to Artem Frolov for his invaluable assistance and guidance in the development of this project.
- LinkedIn: Artem Frolov
- GitHub: AqueGen
License:
This project is licensed under the MIT License.
Installation and Configuration
This section guides you through setting up and configuring the necessary components for the project using Dependency Injection (DI).
Direct Instantiation
To manually instantiate the components without using DI, use the following example:
using NPKTools.Optimizer.PpmTargetParser;
using NPKTools.Core.Domain.PpmTarget;
// Manually creating an instance of PpmTargetParser without DI
PpmTargetParser ppmTargetParser = new PpmTargetParser();
Using Dependency Injection For integrating these components into a project that supports Dependency Injection, such as an ASP.NET Core application, configure your services in the Startup.cs or a similar configuration file as follows:
public void ConfigureServices(IServiceCollection services)
{
// Registering services in the DI container
services.AddSingleton<IPpmTargetParser, PpmTargetParser>();
}
Example usage
string input = "N=150, P=50, K=200, Ca=40, Mg=30";
try
{
PpmTarget target = ppmTargetParser.Parse(input);
Console.WriteLine("Parsing successful! Target values are set.");
}
catch (Exception ex)
{
Console.WriteLine($"Error parsing input: {ex.Message}");
}
Dependencies
NPKTools.Optimizer.PpmTargetParser.Tests
- xUnit: Framework for unit testing.
- AutoFixture: Generates test data.
- FluentAssertions: Enhanced assertions for tests.
- Microsoft.AspNetCore.Mvc.Testing: Testing for ASP.NET MVC applications.
- NSubstitute: Library for creating mock and stub objects.
- Microsoft.NET.Test.Sdk: Test SDK for .NET.
Contact Information:
- LinkedIn: Anatoliy Yermakov
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. |
-
net8.0
- NPKTools.Core (>= 1.1.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
GitHub workflows integration