Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any examples using minimal api ? #1

Open
wilz055 opened this issue Aug 24, 2024 · 2 comments
Open

any examples using minimal api ? #1

wilz055 opened this issue Aug 24, 2024 · 2 comments

Comments

@wilz055
Copy link

wilz055 commented Aug 24, 2024

Could you please provide any examples using minimal api for file upload.

@themisir
Copy link
Owner

All the provided samples (code pieces, example implementation) should map 1:1 to minimal APIs. Just replace services with builder.Services and endpoints with app.Map....

@wilz055
Copy link
Author

wilz055 commented Aug 24, 2024

I tried your examples, to upload file to s3, its throwing service not registered error in .net core 8.0. If you could add some sample code to consume, would be more helpful
added

builder.Services.AddAmazonS3(builder.Configuration.GetSection("AmazonS3"));
services.AddUploadNet()
        .AddAwsS3Provider("public", options =>
        {
            options.BucketName = "public-images";
        });
like 

endpoint.MapPost( IFormFile file , StorageManager _storageManager) 
await _storageManager.CreateFile("public", "users/1553/profile.png", inputStream);

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

No branches or pull requests

2 participants