NeedfulThings.Personnummer 0.1.55

dotnet add package NeedfulThings.Personnummer --version 0.1.55
                    
NuGet\Install-Package NeedfulThings.Personnummer -Version 0.1.55
                    
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="NeedfulThings.Personnummer" Version="0.1.55" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NeedfulThings.Personnummer" Version="0.1.55" />
                    
Directory.Packages.props
<PackageReference Include="NeedfulThings.Personnummer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NeedfulThings.Personnummer --version 0.1.55
                    
#r "nuget: NeedfulThings.Personnummer, 0.1.55"
                    
#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.
#:package NeedfulThings.Personnummer@0.1.55
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NeedfulThings.Personnummer&version=0.1.55
                    
Install as a Cake Addin
#tool nuget:?package=NeedfulThings.Personnummer&version=0.1.55
                    
Install as a Cake Tool

Swedish Social security number "PersonNummer"

PersonNummer is a object to work with swedish social security numbers.

Creating a PersonNummer object instance


//Create a PersonNummer object from a string 
//If the string is not a valid personnummer a exception is thrown.
var pNumber = new PersonNummer("19840123-4680");

//Create a PersonNummer object from a string 
//If the string is not a valid personnummer a exception is thrown.
PersonNummer pNumber = "19840123-4680";

Validate a PersonNummer string


//Returns true if the string is a valid personnummer else false, out result is the PersonNummer object.
bool isValid = PersonNummer.TryParse("19840123-4686", out PersonNummer result);

The object of a PersonNummer has the following properties

The date separated as year, month, day and the last four " PlaceOfBirthAsNumber, SexAsNumber and control number."
The Place of birth if year is befor 1990. after that the place of birth numbers is a random number The sex of the person

<a id="jumpemail"></a>

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on NeedfulThings.Personnummer:

Package Downloads
NeedfulThings.Plethora

Collection of helpers and extensions

NeedfulThings.Attributes

Package Description

NeedFulThings.Fakes

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.55 232 1/19/2026
0.1.54 167 1/18/2026