Table of Contents

Class BlobPathResolver

Namespace
CloudStorageORM.Infrastructure
Assembly
CloudStorageORM.dll
public class BlobPathResolver : IBlobPathResolver
Inheritance
BlobPathResolver
Implements
Inherited Members

Constructors

BlobPathResolver(IStorageProvider)

public BlobPathResolver(IStorageProvider storageProvider)

Parameters

storageProvider IStorageProvider

Methods

GetBlobName(Type)

Builds the deterministic blob folder name for the specified entity type.

public string GetBlobName(Type type)

Parameters

type Type

Entity CLR type used to derive the blob folder.

Returns

string

The provider-safe blob folder name for the entity type.

Examples

var folder = resolver.GetBlobName(typeof(User));
// Example output: "a1b2c3d4e5f6g7h8-user"

GetPath(IUpdateEntry)

Builds the full blob path from an EF update entry.

public string GetPath(IUpdateEntry entry)

Parameters

entry IUpdateEntry

Change-tracked EF entry that contains entity metadata and key values.

Returns

string

The full blob path for the tracked entity.

Examples

var path = resolver.GetPath(updateEntry);

GetPath(Type, object)

Builds the full blob path for an entity type and primary key value.

public string GetPath(Type type, object keyValue)

Parameters

type Type

Entity CLR type that owns the blob.

keyValue object

Primary key value used to identify the entity blob.

Returns

string

The full blob path including folder and json file name.

Examples

var path = resolver.GetPath(typeof(User), "42");
// Example output: "a1b2c3d4e5f6g7h8-user/42.json"