MCPcopy Create free account
hub / github.com/TryCatchLearn/Restore-v2 / AddImageAsync

Method AddImageAsync

API/Services/ImageService.cs:23–39  ·  view source on GitHub ↗
(IFormFile file)

Source from the content-addressed store, hash-verified

21 }
22
23 public async Task<ImageUploadResult> AddImageAsync(IFormFile file)
24 {
25 var uploadResult = new ImageUploadResult();
26
27 if (file.Length > 0)
28 {
29 using var stream = file.OpenReadStream();
30 var uploadParams = new ImageUploadParams
31 {
32 File = new FileDescription(file.FileName, stream),
33 Folder = "rs-course"
34 };
35 uploadResult = await _cloudinary.UploadAsync(uploadParams);
36 }
37
38 return uploadResult;
39 }
40
41 public async Task<DeletionResult> DeleteImageAsync(string publicId)
42 {

Callers 2

CreateProductMethod · 0.80
UpdateProductMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected