Len.StronglyTypedId.SystemTextJson 1.0.2

Suggested Alternatives

Len.StronglyTypedId

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Len.StronglyTypedId.SystemTextJson --version 1.0.2
NuGet\Install-Package Len.StronglyTypedId.SystemTextJson -Version 1.0.2
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="Len.StronglyTypedId.SystemTextJson" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Len.StronglyTypedId.SystemTextJson --version 1.0.2
#r "nuget: Len.StronglyTypedId.SystemTextJson, 1.0.2"
#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 Len.StronglyTypedId.SystemTextJson as a Cake Addin
#addin nuget:?package=Len.StronglyTypedId.SystemTextJson&version=1.0.2

// Install Len.StronglyTypedId.SystemTextJson as a Cake Tool
#tool nuget:?package=Len.StronglyTypedId.SystemTextJson&version=1.0.2

StronglyTypedId NuGet

A base implementation of strongly typed ids.

Getting started

  1. Install the standard Nuget package into your application or library.

    Package Manager : Install-Package Len.StronglyTypedId -Version 1.0.2
    CLI : dotnet add package --version 1.0.2 Len.StronglyTypedId
    
  2. Use record to define strongly-typed ids:

    public record struct OrderId(Guid Value) : IStronglyTypedId<Guid>
    {
        public static IStronglyTypedId<Guid> Create(Guid value) => new OrderId(value);
    }
    

    or

    public record OrderId(Guid Value) : IStronglyTypedId<Guid>
    {
        public static IStronglyTypedId<Guid> Create(Guid value) => new OrderId(value);
    }
    

System.Text.Json (STJ) or Newtonsoft

If you need to use strongly typed ids as output parameters for back-end interfaces in ASP. Net Core applications, you need to perform the following steps:

  1. Install the System.Text.Json (STJ) package or Newtonsoft package into the ASP.NET Core program.

     Package Manager : Install-Package Len.StronglyTypedId.SystemTextJson -Version 1.0.2
     CLI : dotnet add package --version 1.0.2 Len.StronglyTypedId.SystemTextJson
    

    or

    Package Manager : Install-Package Len.StronglyTypedId.NewtonsoftJson -Version 1.0.2
    CLI : dotnet add package --version 1.0.2 Len.StronglyTypedId.NewtonsoftJson
    

    Note: Only one of them can be selected.

  2. Enable strongly typed ids in the JsonOptions configuration.

    services.AddControllers().AddJsonOptions(options =>
    {
        options.JsonSerializerOptions.UseStronglyTypedId();
    });
    

    or

    services.AddControllers().AddNewtonsoftJson(options =>
    {
        options.SerializerSettings.UseStronglyTypedId();
    });
    
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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