Skip to content

Add functions to store blob, get blob, directly assign blob to html element (.NET 6 Compatible)#54

Open
Tailslide wants to merge 24 commits into
amuste:masterfrom
Tailslide:net6blobs
Open

Add functions to store blob, get blob, directly assign blob to html element (.NET 6 Compatible)#54
Tailslide wants to merge 24 commits into
amuste:masterfrom
Tailslide:net6blobs

Conversation

@Tailslide
Copy link
Copy Markdown

@Tailslide Tailslide commented Sep 16, 2022

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 blob from the store (fast, .NET 6+ ONLY)

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

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

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");

@sveins12
Copy link
Copy Markdown

Why isn't this merged?

@Tailslide
Copy link
Copy Markdown
Author

Why isn't this merged?

The author is showing no commits to github for like 9 months it's possible this got abandoned.
I updated to .NET 7 and published an unofficial nuget to make my life easier.
The current branch is here:

https://github.com/Tailslide/DnetIndexedDb/tree/newpublish

@sveins12
Copy link
Copy Markdown

@Tailslide do you plan to add an issue tracker/discussions for that repository?

@Tailslide
Copy link
Copy Markdown
Author

@Tailslide do you plan to add an issue tracker/discussions for that repository?

@sveins12 Sure I just added them but I hope @amuste returns at some point so we can merge things back together

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.

2 participants