Benevia.Core.Blobs 0.9.16

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Benevia.Core.Blobs --version 0.9.16
                    
NuGet\Install-Package Benevia.Core.Blobs -Version 0.9.16
                    
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="Benevia.Core.Blobs" Version="0.9.16" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Benevia.Core.Blobs" Version="0.9.16" />
                    
Directory.Packages.props
<PackageReference Include="Benevia.Core.Blobs" />
                    
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 Benevia.Core.Blobs --version 0.9.16
                    
#r "nuget: Benevia.Core.Blobs, 0.9.16"
                    
#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 Benevia.Core.Blobs@0.9.16
                    
#: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=Benevia.Core.Blobs&version=0.9.16
                    
Install as a Cake Addin
#tool nuget:?package=Benevia.Core.Blobs&version=0.9.16
                    
Install as a Cake Tool

Benevia.Core.Blobs

Maintainers

Introduction

Provides blob storage capabilities for the Benevia Core platform, supporting both Azure Blob Storage and local file system storage. Offers secure URL generation for direct client uploads/downloads as well as getting the blob as Base64 strings.

Setup

Configure blob storage provider in your DI container:

Azure Blob Storage:

services.AddCoreBlobsAzure(options =>
{
    options.StorageAccountUri = new Uri("https://mystorageaccount.blob.core.windows.net");
    options.Credentials = new ManagedIdentityCredential(); //see https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication/system-assigned-managed-identity for set up
});

In Azure, ensure the identity has the Storage Blob Delegator and Storage Blob Data Contributor permissions. The urls returned will require a Content-Type and BlockBlob: 'BlockBlob' header.

Local File Storage:

services.AddCoreBlobsLocal(options =>
{
    options.StorageDirectory = @"C:\BlobStorage";
});

Usage

  1. Add the Blob entity in your model:
[ApiEntity]
public partial class Product
{
    // ...

    [ReferenceProperty("Image", DeleteAction.SetNull, ReferenceType.OneToOne,
        Description = "An image of the product")]
    public virtual partial Blob? Image { get; set; }

    // ...
}
  1. Use via OData API:

Create a Product with an Image Blob:

POST /api/Product?$select=Guid&$expand=Image($select=UploadUrl)
Content-Type: application/json

{
  "Sku": "PRODUCT-123",
  "Image": {
    "Name": "product-image.png"
  }
}

Upload Image:

Azure Blob Storage:

PUT {UploadUrl from previous response}
Content-Type: image/png
x-ms-blob-type: BlockBlob

{binary image data}

Local Storage: Local storage supports both POST and PUT methods. You can upload using multipart/form-data or by sending the binary content directly in the body.

PUT {UploadUrl from previous response}
Content-Type: image/png

{binary image data}

Retrieve Image in Base64 format:

GET /api/Product({Guid})?$select=Guid,Image&$expand=Image($select=Base64Content,DownloadUrl,Name)

Download Image:

GET {DownloadUrl from previous response}

Notes

<details> The Blob entity provides virtual properties for download URLs, upload URLs, and Base64 content that are computed through the configured blob provider. Supports both direct streaming through URLs and content as Base64-encoded string. </details>

Product 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. 
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
0.9.17-ci.136 0 5/13/2026
0.9.17-ci.135 0 5/13/2026
0.9.17-ci.134 31 5/12/2026
0.9.17-ci.133 46 5/11/2026
0.9.17-ci.132 86 5/11/2026
0.9.17-ci.131 49 5/11/2026
0.9.17-ci.130 62 5/11/2026
0.9.17-ci.129 43 5/10/2026
0.9.17-ci.128 50 5/9/2026
0.9.17-ci.127 40 5/9/2026
0.9.17-ci.126 68 5/8/2026
0.9.17-ci.125 47 5/7/2026
0.9.17-ci.124 117 5/7/2026
0.9.17-ci.123 80 5/6/2026
0.9.17-ci.122 52 5/6/2026
0.9.17-ci.121 76 5/6/2026
0.9.17-ci.120 51 5/5/2026
0.9.17-ci.119 51 5/5/2026
0.9.17-ci.118 42 5/5/2026
0.9.16 193 4/28/2026
Loading failed