Acontplus.Common.S3Application 1.1.3

dotnet add package Acontplus.Common.S3Application --version 1.1.3                
NuGet\Install-Package Acontplus.Common.S3Application -Version 1.1.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Acontplus.Common.S3Application" Version="1.1.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Acontplus.Common.S3Application --version 1.1.3                
#r "nuget: Acontplus.Common.S3Application, 1.1.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Acontplus.Common.S3Application as a Cake Addin
#addin nuget:?package=Acontplus.Common.S3Application&version=1.1.3

// Install Acontplus.Common.S3Application as a Cake Tool
#tool nuget:?package=Acontplus.Common.S3Application&version=1.1.3                

Common.S3Application

License: MIT

A lightweight .NET library providing a simple and consistent interface for AWS S3 storage operations. This package implements basic CRUD operations for S3 objects with async support.

Features

  • Asynchronous S3 operations
  • Strongly-typed S3 object handling
  • Custom response wrapping
  • Simple CRUD interface
  • Task-based operation support

Installation

dotnet add package Common.S3Application

Quick Start

1. Interface Implementation

public interface IS3StorageService
{
    Task<S3Response> UploadAsync(S3ObjectCustom s3ObjectCustom);
    Task<S3Response> UpdateAsync(S3ObjectCustom s3ObjectCustom);
    Task<S3Response> DeleteAsync(S3ObjectCustom s3ObjectCustom);
}

2. Basic Usage

public class MyS3Service
{
    private readonly IS3StorageService _s3StorageService;

    public MyS3Service(IS3StorageService s3StorageService)
    {
        _s3StorageService = s3StorageService;
    }

    public async Task UploadFileAsync(string fileName, byte[] content)
    {
        var s3Object = new S3ObjectCustom
        {
            FileName = fileName,
            Content = content
        };

        var response = await _s3StorageService.UploadAsync(s3Object);
    }
}

Dependencies

  • .NET Standard 2.0+
  • AWS SDK for .NET
  • Common.Core (for S3Response and S3ObjectCustom types)

Configuration

Add the following to your appsettings.json:

{
  "AWS": {
    "Region": "your-region",
    "BucketName": "your-bucket-name"
  }
}

Service Registration

services.AddScoped<IS3StorageService, S3StorageService>();

Error Handling

The service returns S3Response objects which include:

  • Success/failure status
  • Error messages if applicable
  • Operation metadata

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

Copyright (c) 2024 [Acontplus S.A.S.]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.3 102 11/25/2024
1.1.2 80 11/18/2024
1.1.1 87 11/14/2024
1.1.0 88 11/14/2024
1.0.0 87 10/29/2024