Skip to content

uniteeio/dotnet-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unitee utils

Various of methods, tools and extensions used commonly in Unitee.

logo

Fluent blob storage

Fluent API for Azure Blob Storage manipulation.

// Setup
var storage = new FluentBlobStorage()
    .WithConnectionString("xxxxxx")
    .WithContainerName("documents");

// Upload a stream
using var fileStream = new FileStream(@"/app/file.txt", FileMode.Open);

var (uri, response) = await storage
    .WithFileName("file.txt")
    .WithContentType("text/plain")
    .UploadAsync(filestream);

// Upload IFormFile
var formFile = req.File;

var (uri, response) = await storage
    .WithFileName("file.txt")
    .WithContentType("text/plain")
    .UploadAsync(formFile);

// Download
var (stream, blobProperties) = storage
    .WithFileName("file.txt")
    .OpenRead();

var contentType = blobProperties.ContentType;
return File(stream, contentType);

Extensions Methods

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages