Skip to content

Add functions to store blob, get blob, directly assign blob to html element#46

Open
Tailslide wants to merge 20 commits into
amuste:masterfrom
Tailslide:fixindexerror
Open

Add functions to store blob, get blob, directly assign blob to html element#46
Tailslide wants to merge 20 commits into
amuste:masterfrom
Tailslide:fixindexerror

Conversation

@Tailslide
Copy link
Copy Markdown

@Tailslide Tailslide commented May 21, 2021

There is also a new WASM test project where you can play with the new functions
Implements Issue #45

Add a binary blob to the store

string AddBlobItem<TEntity>(string objectStoreName, TEntity item, string mimeType, string key = "")

  var result = await BlobDb.AddBlobItem<byte[]>("StoreName", Blob,"image/jpeg", "myrecordkey1");

Update binary blob in the store

string UpdateBlobByKey<TEntity>(string objectStoreName, TEntity item, string mimeType, string key)

  var result = BlobDb.UpdateBlobByKey<byte[]>("StoreName", Blob, "image/png", "myrecordkey1");

Get marshalled base 64 encoded blob from the store (slow!)

ValueTask<string> GetBlobByKey(string objectStoreName, key)

  var result = await BlobDb.GetBlobByKey("StoreName", "myrecordkey1");

Get unmarshalled blob from the store int .net buffer (fast)

ValueTask<string> GetBlobByKey(string objectStoreName, key, byte[] destination, int maxBytes)

  var result = await BlobDb.GetBlobByKey("StoreName", "myrecordkey1", mybuffer, mybuffermaxsize);

Assign blob directly to HTML element without marshalling into .NET (fast)

ValueTask<string> AssignBlobToElement(string objectStoreName, string key, string elementId, string attribute)

  var result = await BlobDb.AssignBlobToElement("StoreName", "myrecordkey1", "myimagetagId","src");

@Ulf-Ason
Copy link
Copy Markdown

Do you think it's far away to get this PR merged?

@amuste
Copy link
Copy Markdown
Owner

amuste commented Oct 13, 2021

Do you think it's far away to get this PR merged?

Hi there. I am working on a more extensive set of components for Blazor which I want to release together with the release of .Net6, this is the reason why I have not been able to spend a lot of time carefully reviewing the contributions they have made and for which I am grateful to collaborators. I will try in the next few days to review what is pending and publish a new version. If it is not possible, after the launch of .Net6 I will be able to publish a new version. Thank you very much for using the library

@andersson09
Copy link
Copy Markdown

andersson09 commented Oct 31, 2021

Do you think it's far away to get this PR merged?

Hi there. I am working on a more extensive set of components for Blazor which I want to release together with the release of .Net6, this is the reason why I have not been able to spend a lot of time carefully reviewing the contributions they have made and for which I am grateful to collaborators. I will try in the next few days to review what is pending and publish a new version. If it is not possible, after the launch of .Net6 I will be able to publish a new version. Thank you very much for using the library

For .NET 6 will you support reading and writing blobs/files as a stream using the latest JsRuntime (dotnet/aspnetcore#34817)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants