Ft.Datafangst.Utils 1.6.6

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

// Install Ft.Datafangst.Utils as a Cake Tool
#tool nuget:?package=Ft.Datafangst.Utils&version=1.6.6

Utilities

Contains various utilities related to development of Ft.Datafangst logic.

Add to project

dotnet add package Ft.Datafangst.Utils

NB! Must be in the project folder that it is to be added to!

Installation

To install do the following commands

dotnet tool install --global Ft.Datafangst.Utils

Update

To update do the following commands

dotnet tool update --global Ft.Datafangst.Utils

ModelStateDictionaryExtension

IsConditionInError

Adds or removes a specified errorMessage to the Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry.Errors instance that is associated with the specified key depending on the state.

  • Param:
    • modelStateDic:Represents the state of an attempt to bind values from an HTTP Request to an action method, which includes validation information.
    • state: The criteria that gives the state where there is an error or not.
    • key: The key of the Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateEntry to add errors
    • errorMsg: The error message to add
  • Return:
    • A representative numerical value for the Language. Basic Example in C#
        ModelStateDictionary validationResults = new ModelStateDictionary();
        var key = "organisasjonsnummer";
        var errorMsg = "testError";
        var someCriteria = 2 + 1 == 4; //Which is false.
        validationResults.IsConditionInError(someCriteria, key, errorMsg);

StringExtensions

IsOrganizationNumberValid

Validates if orgNr is a valid Organization (Business Registration) number

  • Param:
    • organizationNumber: The Organization (Business Registration) number that is to be checked if it is valid(9 digits string of numbers)
  • Return:
    • Returns true or false depending in if organizationNumber number is valid or not Basic Example in C#
     true = "123456789".ConvertLanguageStringToDecimal();
     false = "123".ConvertLanguageStringToDecimal();

IsIsinValid

Checks if the provided string is a valid ISIN code.

  • Param:
    • isinCode: The Organization (Business Registration) number that is to be checked if it is valid(9 digits string of numbers)
  • Return:
    • Returns true or false depending in if valid ISIN code Basic Example in C#
     true = "No1234567890".ConvertLanguageStringToDecimal();
     false = "No123".ConvertLanguageStringToDecimal();

IsLeiValid

Checks if the provided string is a valid Legal Entity Identifier (LEI)

  • Param: -lei: An LEI is a 20-character alphanumeric code that follows a specific format. (ISO 17442: The Global Standard) It consists of four parts: - Characters 1-4: Prefix used to ensure the uniqueness among codes from LEI issuers (Local Operating Units or LOUs). - Characters 5-18: Entity-specific part of the code generated and assigned by LOUs according to transparent, sound and robust allocation policies. As required by ISO 17442, it contains no embedded intelligence. - Characters 19-20: Two check digits as described in the ISO 17442 standard.
  • Return:
    • Returns true or false depending in if valid LEI code Basic Example in C#
     true = "123400ABCDE7810FGH07".ConvertLanguageStringToDecimal();
     false = "7ZW8QJWVPR4P1J".ConvertLanguageStringToDecimal();

ConvertLanguageStringToNumeric

Converts two-letter language identifier from string (eg. "nb") to it's numerical representative. Defaults to english (1033) if no matching language string is found.

  • Param:
    • language: To char string (e.g. "nb" for Norwegian)
      • nb: 1044
      • nn: 2068
      • Default: 1033
  • Return:
    • A representative numerical value for the Language.

Basic Example in C#

     1044 = "nb".ConvertLanguageStringToDecimal();
     1033 = null.ConvertLanguageStringToDecimal();

GetLanguageAsNumeric

Gets the language that is set up with the user profile and converts

  • Param:
    • userProfile: User profile to get language form
  • Return:
    • A representative numerical value for the Language.

SetPeriode

Sets up the periode from periode type and year. Year is optional.

  • Param:
    • periodeType: A representational code for a part of the year.

      • H1: 1. Halvår
      • H2: 2. Halvår
      • Q1: 1. Kvartal
      • Q2: 2. Kvartal
      • Q3: 3. Kvartal
      • Q4: 4. Kvartal
      • M1: Januar
      • M2: Februar
      • M3: Mars
      • M4: April
      • M5: Mai
      • M6: Juni
      • M7: Juli
      • M8: August
      • M9: September
      • M10: Oktober
      • M11: November
      • M12: Desember
      • Y: År
      • O: Løpende rapportering
    • year:

  • Return:
    • Returns a string set together with the string from userProfile code and the year.

Basic Example in C#

     "1. halvår 2023" = "H1".SetPeriode(2023);
     "1. halvår" = "H1".SetPeriode();
     "År 2023" = null.SetPeriode("2023");
     "" = null.SetPeriode("");
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
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.6.16 180 3/11/2024
1.6.14 149 2/5/2024
1.6.13 92 2/1/2024
1.6.12 269 1/4/2024
1.6.11 137 12/19/2023
1.6.10 284 11/21/2023
1.6.9 166 11/14/2023
1.6.8 174 10/30/2023
1.6.7 154 10/26/2023
1.6.6 114 10/25/2023
1.6.4 147 10/19/2023
1.6.3 143 10/18/2023
1.6.2 156 10/12/2023
1.6.1 171 9/21/2023
1.6.0 183 8/31/2023
1.5.3 392 5/25/2023
1.5.2 339 4/4/2023
1.5.0 335 3/16/2023
1.4.0 312 3/8/2023
1.3.0 266 3/2/2023
1.2.1 244 3/2/2023
1.2.0 249 3/2/2023
1.1.2 223 3/2/2023
1.1.1 235 3/2/2023
1.0.5 256 2/14/2023
1.0.4 261 2/14/2023