WeCanLibrary 1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package WeCanLibrary --version 1.0.0
NuGet\Install-Package WeCanLibrary -Version 1.0.0
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="WeCanLibrary" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WeCanLibrary --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WeCanLibrary, 1.0.0"
#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 WeCanLibrary as a Cake Addin #addin nuget:?package=WeCanLibrary&version=1.0.0 // Install WeCanLibrary as a Cake Tool #tool nuget:?package=WeCanLibrary&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WeCanLibrary
A single library to support multiple dotnet application features.
Projects
WeCanLibrary
is a Class Library written in dotnet6 and is the main project of this solution.WeCanLibrary.IntegrationTests
is a WebApi project in dotnet6 to install and perform integration tests on the packageWeCanLibrary.UnitTests
is a XUnit Test project to cover the libary with good unit test coverage
Supports Api Key Authentication
The WeCanLibrary supports ApiKey authentication.
Configuration
- Install the package
WeCanLibrary
using Nuget Package Manager - Add the below configuration in the
appsettings.json
"ApiKeyConfiguration": {
"ApiKey": "<<your_api_key>>"
}
- Add the
AzureBlobHandlerService
in the Program.cs using below code
builder.Services.AddApiKeyAuthentication(configuration);
Procedure
- The requests made to API needs to have a header with a key
X-API-KEY
and a value assigned to it - The library expects a configuration section which contains the ApiKey
- The WeCanLibrary reads the request and retrieves the ApiKey value
- It then validates the retreived value with the configured value
- Authorization result is returned based on the validation result
Supports Azure Blob Service
The WeCanLibrary supports file handling using Azure Blob service.
Pre-requisites
- Microsoft Azure Blob container with a ConnectionString. You can learn more about configuring connection string for Azure Storage account here
- Dotnet6 application
Configuration
- Install the package
WeCanLibrary
using Nuget Package Manager - Add the below configuration in the
appsettings.json
"AzureBlobConfiguration": {
"ConnectionString": "<<Your_Azure_Blob_Connection_String>>"
}
- Add the
AzureBlobHandlerService
in the Program.cs using below code
builder.Services.AddAzureBlobHandlerService(configuration);
Procedure
- Inject the
IAzureBlobHandlerService
interface in the target service. - Invoke the methods
UploadBlob
,DownloadBlob
andDeleteBlob
for Uploading, Downloading and Deleting the blobs - For uploading the file to the blob container, the library requires
- Container Name
MemoryStream
of the file to be processed
- For downloading and deleting the file from blob container, the lobrary requires
- Container Name
- Blob Name
- The response from the service contains the
IsSuccess
flag indicating whether the transaction is successful or notBlob
- Contains the memory stream of the downloaded fileError
- Contains the exception which occurred during the processMessage
- Transaction message
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.0
- Azure.Storage.Blobs (>= 12.16.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 6.0.16)
- Microsoft.Extensions.Configuration.Abstractions (>= 6.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.3)
- Microsoft.Extensions.Options (>= 6.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial Cut