Built-in Methods & Architecture Overview
Exploring Entity Service Execution Forms, Core Framework Benefits, and Modern Design Principles in AUA
Entity Service Execution Forms
All built-in data manipulation methods within AUA Entity Services are available in three powerful execution forms to optimize performance, concurrency, and thread management:
Core Built-in Service Methods
Includes Insert(dto/entity), InsertAsync(...), custom view model injection (InsertCustomVm), partial saving via PartialInsert, and batch operations (InsertMany / InsertManyAsync).
Includes standard deletion by ID, DTO, or entity instance, asynchronous variants, and TryDelete functions that safely return a boolean status indicating execution success.
Modern Architecture Principles
AUA is engineered using cutting-edge design concepts to guarantee maintainability, high performance, and structured modular expansion:
Key Framework Infrastructures
- Service and reporting infrastructure with unified naming patterns.
- Built-in caching layers (In-Memory) and security/encryption handlers.
- Advanced modeling, mapping, and user access control levels.
- Pre-tested modules minimizing developer overhead and error rates.
Built-in Service Methods & CancellationToken Examples
Below are practical code implementations showing how to invoke AUA built-in generic CRUD operations using Async, CancellationToken, and TryDelete directly within your business services:
public class StudentService : GenericEntityService<Student, StudentDto>, IStudentService
{
public StudentService(IUnitOfWork unitOfWork) : base(unitOfWork) { }
// 1. Async Insert with DTO & CancellationToken Support
public async Task<long> CreateStudentAsync(StudentDto dto, CancellationToken cancellationToken = default)
{
// Automatically maps DTO to Entity and persists to DbContext
var studentId = await InsertAsync(dto, cancellationToken);
return studentId;
}
// 2. Batch Processing using InsertManyAsync
public async Task AddMultipleStudentsAsync(IEnumerable<StudentDto> studentDtos)
{
await InsertManyAsync(studentDtos);
}
// 3. Safe Deletion returning Boolean status via TryDeleteAsync
public async Task<bool> RemoveStudentIfExistsAsync(long studentId)
{
bool isDeleted = await TryDeleteAsync(studentId);
return isDeleted;
}
}
"If you think good architecture is expensive, try bad architecture."AUA Framework Philosophy