Devlooped.TableStorage.Bson.Source 5.1.0

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

// Install Devlooped.TableStorage.Bson.Source as a Cake Tool
#tool nuget:?package=Devlooped.TableStorage.Bson.Source&version=5.1.0                

A source-only BSON binary serializer for use with document-based repositories.

Usage:

  var repo = DocumentRepository.Create<Product>(..., serializer: BsonDocumentSerializer.Default);

Document Storage

The DocumentRepository.Create and DocumentPartition.Create factory methods provide access to document-based storage, exposing the a similar API as column-based storage.

Document repositories cause entities to be persisted as a single document column, alongside type and version information to handle versioning a the app level as needed.

The API is mostly the same as for column-based repositories (document repositories implement the same underlying ITableStorage interface):

public record Product(string Category, string Id) 
{
  public string? Title { get; init; }
  public double Price { get; init; }
  public DateOnly CreatedAt { get; init; }
}

var book = new Product("book", "9781473217386")
{
    Title = "Neuromancer",
    Price = 7.32
};

// Column-based storage
var repo = TableRepository.Create<Product>(
    CloudStorageAccount.DevelopmentStorageAccount,
    tableName: "Products",
    partitionKey: p => p.Category,
    rowKey: p => p.Id);

await repo.PutAsync(book);

// Document-based storage
var docs = DocumentRepository.Create<Product>(
    CloudStorageAccount.DevelopmentStorageAccount,
    tableName: "Documents",
    partitionKey: p => p.Category,
    rowKey: p => p.Id
    serializer: [SERIALIZER]);

await docs.PutAsync(book);

If not provided, the serializer defaults to the System.Text.Json-based DocumentSerializer.Default.

The resulting differences in storage can be seen in the following screenshots of the Azure Storage Explorer:

Screenshot of entity persisted with separate columns for properties

Screenshot of entity persisted as a document

The Type column persisted in the documents table is the Type.FullName of the persisted entity, and the Version is the [Major].[Minor] of its assembly, which could be used for advanced data migration scenarios. The major and minor version components are also provided as individual columns for easier querying by various version ranges, using IDocumentRepository.EnumerateAsync(predicate).

Sponsors

Clarius Org C. Augusto Proiete Kirill Osenkov MFB Technologies, Inc. Stephen Shaw Torutek DRIVE.NET, Inc. David Kean alternate text is missing from this package README image Daniel Gnägi Ashley Medway Keith Pickford bitbonk Thomas Bolon Yurii Rashkovskii Kori Francis Zdenek Havlin Sean Killeen Toni Wenzel Giorgi Dalakishvili Kelly White Allan Ritchie Mike James Uno Platform Dan Siegel Reuben Swartz Jeremy Simmons Jacob Foshee alternate text is missing from this package README image Eric Johnson Norman Mackay Certify The Web Taylor Mansfield Mårten Rånge David Petric Rich Lee Danilo Dantas alternate text is missing from this package README image Gary Woodfine alternate text is missing from this package README image alternate text is missing from this package README image Steve Bilogan Ix Technologies B.V. New Relic Chris Johnston‮ David JENNI alternate text is missing from this package README image Jonathan Oleg Kyrylchuk

Sponsor this project  

Learn more about GitHub Sponsors

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
5.2.1 96 10/22/2024
5.2.0 87 7/24/2024
5.2.0-rc.1 52 7/13/2024
5.2.0-rc 79 7/10/2024
5.2.0-beta 92 7/6/2024
5.1.2 158 1/25/2024
5.1.1 287 10/4/2023
5.1.0 325 8/11/2023
5.0.2 227 8/8/2023
5.0.1 197 7/25/2023
5.0.0 180 7/25/2023
4.3.1 207 7/24/2023
4.3.0 177 6/27/2023
4.2.1 208 4/17/2023
4.2.0 207 3/28/2023
4.1.3 312 1/20/2023
4.1.2 288 1/16/2023
4.0.0 411 8/26/2022
4.0.0-rc.1 99 8/26/2022
4.0.0-rc 217 8/15/2022
4.0.0-beta 244 5/17/2022
4.0.0-alpha 216 5/4/2022
3.2.0 593 12/13/2021
3.1.1 400 8/29/2021
3.1.0 426 8/13/2021
3.0.3 413 7/28/2021
3.0.2 416 7/1/2021
3.0.1 455 7/1/2021
3.0.0 450 7/1/2021
2.0.2 423 6/23/2021
2.0.1 444 6/17/2021
2.0.0 519 6/16/2021
1.3.0 405 5/31/2021