AUA Framework Training — Episode 20

Validation Service & Core Architecture Services

Mastering Request Validation, InMemory Caching, SQL Views, and External Provider Integration in AUA

Watch Video on YouTube

1. Validation Service

One of the most vital services of the AUA framework is request validation. All incoming requests are strictly validated prior to processing, covering data structures, foreign keys, and business rules. Custom view model validators can be created within minutes, boosting performance and preventing unnecessary resource waste while seamlessly supporting multiple error structures.

Essential Architecture Services

InMemory Service

Stores low-volume, rarely modified reference data (e.g., basic info, user access) directly in RAM to eliminate redundant database queries. Supports local server memory or distributed solutions like Redis alongside automatic update mechanisms.

Views Service

Bypasses standard EF limitations by allowing developers to map SQL Views directly to custom objects and apply advanced runtime filtering on virtual multi-table datasets.

External Service

Facilitates seamless, clean third-party integrations (SMS panels, payment gateways, microservice communication) using dedicated, standardized communication patterns.

External Provider Service

Dedicated layer responsible solely for mapping and converting external third-party models into native Core Domain entities, maintaining strict separation of concerns.

1. SQL View Script & BaseView Model

UserRolesVw.cs

To map an SQL View in AUA, define the view entity inheriting from BaseView and build a corresponding View DTO with IMapFrom.

// 1. Entity mapped to SQL View
public class UserRolesVw : BaseView
{
    public long UserId { get; set; }
    public string UserName { get; set; }
    public string Title { get; set; }
}

// 2. DTO for View Result Handling
public class UserRolesVwDto : IMapFrom<UserRolesVw>
{
    public long UserId { get; set; }
    public string UserName { get; set; }
    public string Title { get; set; }
}

2. View Service Interface & Implementation

UserRolesVwService.cs
// Interface
public interface IUserRolesVwService : IBaseGenericService<UserRolesVw, UserRolesVwDto> 
{ }

// Service Implementation with UnitOfWork Injection
public class UserRolesVwService : BaseGenericService<UserRolesVw, UserRolesVwDto>, IUserRolesVwService
{
    public UserRolesVwService(IUnitOfWork unitOfWork) : base(unitOfWork) 
    { }
}
“
”
"If you think good architecture is expensive, try bad architecture."
AUA Framework Philosophy

Official Channels & Community

Connect with the AUA Framework ecosystem.

Episode 20 Completed Schema