NCode.PropertyBag.Abstractions
2.1.0
Prefix Reserved
dotnet add package NCode.PropertyBag.Abstractions --version 2.1.0
NuGet\Install-Package NCode.PropertyBag.Abstractions -Version 2.1.0
<PackageReference Include="NCode.PropertyBag.Abstractions" Version="2.1.0" />
<PackageVersion Include="NCode.PropertyBag.Abstractions" Version="2.1.0" />
<PackageReference Include="NCode.PropertyBag.Abstractions" />
paket add NCode.PropertyBag.Abstractions --version 2.1.0
#r "nuget: NCode.PropertyBag.Abstractions, 2.1.0"
#:package NCode.PropertyBag.Abstractions@2.1.0
#addin nuget:?package=NCode.PropertyBag.Abstractions&version=2.1.0
#tool nuget:?package=NCode.PropertyBag.Abstractions&version=2.1.0
NCode.PropertyBag.Abstractions
The interfaces and strongly typed keys of NCode.PropertyBag: IPropertyBag, IReadOnlyPropertyBag, IPropertyBagScope, PropertyBagKey<T> and the extensions that name a key after its variable. Reference this package from a library that accepts or reads a property bag; the application references NCode.PropertyBag, which creates them.
Installation
dotnet add package NCode.PropertyBag.Abstractions
The target frameworks are the ones the package's .csproj declares; they are listed on nuget.org's Frameworks tab and shown by the badge above. CHANGELOG.md records when a framework is added or dropped and which release line to stay on.
Example
A library defines its keys once and reads and writes through the interfaces:
using NCode.PropertyBag;
public static class UserKeys
{
public static readonly PropertyBagKey<string> UserName = new("UserName");
public static readonly PropertyBagKey<int> UserAge = new("UserAge");
}
using NCode.PropertyBag;
public static class ConnectionSettings
{
public static void Save(IPropertyBag propertyBag, string connectionString, TimeSpan timeout)
{
// The keys are named "connectionString" and "timeout", after the arguments.
propertyBag.SetValue(connectionString).SetValue(timeout);
}
public static string? LoadConnectionString(IReadOnlyPropertyBag propertyBag)
{
// Declare the variable first: an inline `out string? connectionString` would name
// the key "string? connectionString".
string? connectionString;
return propertyBag.TryGetValue(out connectionString) ? connectionString : null;
}
}
Learn more
- Documentation site: the quick start, the guides, the concepts and the API map
- README and samples
- API overview
- Changelog
- Report a vulnerability
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- No dependencies.
NuGet packages (28)
Showing the top 5 NuGet packages that depend on NCode.PropertyBag.Abstractions:
| Package | Downloads |
|---|---|
|
NCode.PropertyBag
Strongly typed property bags for .NET: store and read values by type-safe keys, override a value for a scope, clone a bag, and create bags through Microsoft.Extensions.DependencyInjection. |
|
|
NCode.Identity.Jwt.Abstractions
Package Description |
|
|
NCode.Identity.OpenId.Abstractions
Package Description |
|
|
NCode.Identity.OpenId.Accounts.Abstractions
Package Description |
|
|
NCode.Identity.OpenId.Authentication.Abstractions
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
See the changelog: https://github.com/NCodeGroup/PropertyBag/blob/HEAD/CHANGELOG.md