A comprehensive .NET 8.0 helper library providing production-ready utilities for enterprise applications. Coject.Core.Helper streamlines common development tasks with robust implementations for file management, email services, data processing, security, and cloud integration. Key Features: - File Management: Multi-provider support (AWS S3, FTP, Local) with upload, download, and file signature validation - Email Services: Full-featured SMTP integration using MailKit with template support and signature generation - Security: Data encryption, JWT token handling, and barcode generation with ZXing - Data Utilities: JSON processing, date/time helpers, string manipulation, and image handling - Cloud Integration: Seamless AWS S3 operations with configurable storage solutions - API Integration: Helper classes for external service communication Perfect for applications requiring reliable file storage, secure email delivery, data encryption, and cloud service integration. Built with extensibility and performance in mind, this library reduces boilerplate code and accelerates development cycles. Dependencies include MailKit, MimeKit, AWSSDK.S3, System.IdentityModel.Tokens.Jwt, and ZXing.Net.Mobile for comprehensive functionality.
$ dotnet add package Coject.Core.HelperA comprehensive .NET helper library providing essential utilities for file management, email operations, SMS services, data handling, encryption, and integration with cloud services.
Coject.Core.Helper is a production-ready utility library designed to streamline common development tasks in .NET applications. It offers robust implementations for file operations, email services, SMS integration, data manipulation, security features, and multiple storage provider support.
Install via NuGet Package Manager:
dotnet add package Coject.Core.HelperOr via Package Manager Console:
Install-Package Coject.Core.HelperAdd the following configuration to your appsettings.json:
{
"AttachmentSettings": {
"StorageType": "FTP",
"SharedLinkExpiryMinutes": 60,
"EXPIRY_IV_KEY": "ByDz579cdbMMZq8cbzMhtA==",
"AWS": {
"Key": "your-aws-access-key",
"SecretKey": "your-aws-secret-key",
"BucketName": "your-bucket-name"
},
"FTP": {
"Server": "ftp://your-ftp-server.com",
"Username": "ftp-username",
"Password": "ftp-password"
},
"SmsSettings": {
"Provider": "sms-provider-name",
"BaseUrl": "https://sms-gateway.com/",
"SendPath": "api/send",
"UsernameParameter": "username",
"PasswordParameter": "password",
"SenderParameter": "Sender",
"TextParameter": "Text",
"NumberParameter": "number",
"Username": "your-sms-username",
"Password": "your-sms-password",
"Sender": "YourAppName",
"TimeoutSeconds": 30,
"UrlEncodeParameters": true,
"SuccessString": "",
"SuccessCriteria": {
"Type": "json",
"SuccessProperty": "Status",
"SuccessValue": "0"
},
"ErrorCriteria": {
"Type": "string",
"ErrorKeyword": "Error Code"
},
"OTPMessage": "Use the code {0} to log in."
}
}
}| Parameter | Type | Description |
|---|---|---|
StorageType | string | Storage provider to use: "AWS", "FTP", or "Local" |
SharedLinkExpiryMinutes | integer | Duration in minutes before shared links expire |
EXPIRY_IV_KEY | string | Base64 encoded initialization vector for encryption |
| Parameter | Type | Description |
|---|---|---|
Key | string | AWS access key ID |
SecretKey | string | AWS secret access key |
BucketName | string | S3 bucket name for file storage |
| Parameter | Type | Description |
|---|---|---|
Server | string | FTP server URL (include ftp:// or ftps://) |
Username | string | FTP account username |
Password | string | FTP account password |
| Parameter | Type | Description |
|---|---|---|
Provider | string | Name/identifier of the SMS provider |
BaseUrl | string | Base URL of the SMS gateway API |
SendPath | string | API endpoint path for sending SMS |
UsernameParameter | string | Parameter name for username in API request |
PasswordParameter | string | Parameter name for password in API request |
SenderParameter | string | Parameter name for sender ID in API request |
TextParameter | string | Parameter name for message text in API request |
NumberParameter | string | Parameter name for recipient number in API request |
Username | string | Your SMS gateway account username |
Password | string | Your SMS gateway account password |
Sender | string | Default sender name/ID for outgoing messages |
TimeoutSeconds | integer | Request timeout duration (default: 30) |
UrlEncodeParameters | boolean | Whether to URL encode parameters (default: true) |
SuccessString | string | Optional string to match for success (legacy) |
OTPMessage | string | Template for OTP messages. Use {0} for code placeholder |
| Parameter | Type | Description |
|---|---|---|
Type | string | Response format: "json" or "string" |
SuccessProperty | string | JSON property name to check for success (json type only) |
SuccessValue | string | Expected value indicating success |
| Parameter | Type | Description |
|---|---|---|
Type | string | Error detection format: "json" or "string" |
ErrorKeyword | string | Keyword/property indicating an error occurred |
{
"AttachmentSettings": {
"StorageType": "AWS",
"AWS": {
"Key": "AKIAIOSFODNN7EXAMPLE",
"SecretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"BucketName": "my-application-files"
}
}
}{
"AttachmentSettings": {
"StorageType": "FTP",
"FTP": {
"Server": "ftp://files.company.com",
"Username": "fileadmin",
"Password": "SecureP@ssw0rd"
}
}
}{
"AttachmentSettings": {
"SmsSettings": {
"SuccessCriteria": {
"Type": "json",
"SuccessProperty": "Status",
"SuccessValue": "0"
}
}
}
}Expected API response:
{
"Status": "0",
"Message": "SMS sent successfully"
}{
"AttachmentSettings": {
"SmsSettings": {
"SuccessCriteria": {
"Type": "string",
"SuccessValue": "SUCCESS"
},
"ErrorCriteria": {
"Type": "string",
"ErrorKeyword": "ERROR"
}
}
}
}Expected API response: "SUCCESS: Message delivered"
The library automatically uses the configured storage provider based on the StorageType setting:
Upload a file: Files are automatically routed to AWS S3, FTP, or local storage based on configuration
Download a file: Retrieve files from the configured storage provider
Generate shared link: Create temporary links with automatic expiry based on SharedLinkExpiryMinutes
Delete a file: Remove files from the configured storage backend
Send OTP: The library uses the OTPMessage template to format one-time passwords
Send notifications: Send SMS messages through the configured provider
Custom parameters: The library maps your provider's parameter names using the configuration settings
Response validation: Automatically validates success/failure based on SuccessCriteria and ErrorCriteria
Send emails: SMTP integration with attachment support
Generate signatures: Professional email signature generation
HTML/Plain text: Support for both formats with template support
Encrypt data: Uses the configured EXPIRY_IV_KEY for secure encryption
Generate tokens: JWT token generation with configurable expiry
Shared links: Time-based security for temporary file access
CojectCore.Helper/
├── API/
│ └── APIHelper.cs
├── EmailManager/
│ ├── Entity/
│ ├── Interface/
│ └── Service/
├── FileSignatures/
│ ├── Abstract/
│ ├── Formats/
│ ├── Interface/
│ └── Service/
├── FilesManager/
│ ├── Entity/
│ ├── Interface/
│ └── Service/
│ ├── CojectFileControllerHelper.cs
│ ├── CojectFileManager.cs
│ ├── CojectFileManagerAWS.cs
│ ├── CojectFileManagerFTP.cs
│ └── CojectFileManagerHelper.cs
├── BarcodeHelper.cs
├── DateHelper.cs
├── EncryptionHelper.cs
├── FileHelper.cs
├── ImageHelper.cs
├── JsonHelper.cs
├── MapDataHelper.cs
├── SmsHelper.cs
└── StringHelper.cs
This package includes the following key dependencies:
EXPIRY_IV_KEY for enhanced securitySharedLinkExpiryMinutes based on your security requirementsUrlEncodeParameters if your provider requires encoded valuesTimeoutSeconds based on provider response timesOTPMessage to match your application's brandingAWS S3 Connection Fails
Key and SecretKey are correctFTP Connection Fails
Messages Not Sending
BaseUrl and SendPath are correctSuccess/Error Not Detected
SuccessCriteria.Type to match response (json/string)Links Expire Too Quickly
SharedLinkExpiryMinutes valueEncryption Errors
EXPIRY_IV_KEY is valid Base64 stringThis package follows Semantic Versioning (SemVer). Current version: 1.0.36
For issues, feature requests, or contributions, please contact the development team at Akwad Arabia.
Copyright © Akwad Al-Arabia 2024. All rights reserved.
See LICENSE.txt for detailed license information.
Developed and maintained by Akwad Arabia
Part of the Coject Core ecosystem