![]() |
VOOZH | about |
dotnet add package AstreCode.Backend.Shared.Application --version 10.0.0.3
NuGet\Install-Package AstreCode.Backend.Shared.Application -Version 10.0.0.3
<PackageReference Include="AstreCode.Backend.Shared.Application" Version="10.0.0.3" />
<PackageVersion Include="AstreCode.Backend.Shared.Application" Version="10.0.0.3" />Directory.Packages.props
<PackageReference Include="AstreCode.Backend.Shared.Application" />Project file
paket add AstreCode.Backend.Shared.Application --version 10.0.0.3
#r "nuget: AstreCode.Backend.Shared.Application, 10.0.0.3"
#:package AstreCode.Backend.Shared.Application@10.0.0.3
#addin nuget:?package=AstreCode.Backend.Shared.Application&version=10.0.0.3Install as a Cake Addin
#tool nuget:?package=AstreCode.Backend.Shared.Application&version=10.0.0.3Install as a Cake Tool
Application layer components for AstreCode microservices.
The AstreCode.Backend.Shared.Application package provides essential application layer components for building robust and scalable .NET 8.0 backend services. This package includes application services, business logic, validation attributes, and integration utilities.
To install this package, use the .NET CLI:
dotnet add package AstreCode.Backend.Shared.Application
Or via Package Manager Console:
Install-Package AstreCode.Backend.Shared.Application
using Shared.Application;
public class UserService : ApplicationService
{
public UserService(IMapper mapper, IStringLocalizer localizer,
IEncryptionService encryptionService,
IUnitOfWork unitOfWork, ICurrentUser currentUser)
{
}
public async Task<UserDto> CreateUserAsync(CreateUserDto dto)
{
// Your business logic here
var user = _mapper.Map<User>(dto);
await UnitOfWork.GetRepository<User>().AddAsync(user);
await UnitOfWork.SaveChangesAsync();
return _mapper.Map<UserDto>(user);
}
}
public class CreateUserDto
{
[EmailValidator]
public string Email { get; set; }
[PasswordValidator]
public string Password { get; set; }
[SaudiPhoneNumber]
public string PhoneNumber { get; set; }
}
using Shared.Application.FileManagment;
public class FileService
{
private readonly IBlobPublicFileManagement _blobPublic;
private readonly IBlobPrivateFileManagement _blobPrivate;
public async Task<string> UploadFileAsync(Stream fileStream, string fileName)
{
return await _blobPublic.UploadFileAsync(fileStream, fileName);
}
}
public class OrderService
{
private readonly IUnitOfWork _unitOfWork;
public async Task<OrderDto> CreateOrderAsync(CreateOrderDto dto)
{
await _unitOfWork.BeginTransaction();
try
{
var order = new Order();
await _unitOfWork.GetRepository<Order>().AddAsync(order);
await _unitOfWork.SaveChangesAsync();
await _unitOfWork.CommitTransaction();
return _mapper.Map<OrderDto>(order);
}
catch
{
await _unitOfWork.RollbackTransaction();
throw;
}
}
}
// In Program.cs or Startup.cs
builder.Services.ApplicationConfiguration(builder.Configuration);
// In Program.cs or Startup.cs
builder.Services.HangFireConfigureation(builder.Configuration);
// In appsettings.json
{
"BlobStorage": {
"ConnectionString": "your-connection-string",
"PublicContainerName": "public-files",
"PrivateContainerName": "private-files"
}
}
// In appsettings.json
{
"Redis": {
"ConnectionString": "localhost:6379",
"Database": 0
}
}
// In appsettings.json
{
"RabbitMQ": {
"HostName": "localhost",
"Port": 5672,
"UserName": "guest",
"Password": "guest"
}
}
This package depends on the following NuGet packages:
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the file for details.
For support and questions, please contact the AstreCode development team.
See for version history and changes.
AstreCode.Backend.Shared.Application - Version 8.0.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 2 NuGet packages that depend on AstreCode.Backend.Shared.Application:
| Package | Downloads |
|---|---|
|
AstreCode.Backend.Shared.API
The shared API project for AstreCode backend |
|
|
AstreCode.Backend.Shared.UnitTest
The shared UnitTest project for AstreCode backend |
This package is not used by any popular GitHub repositories.