Refactor RootAction to Root in RecActionView

Renamed the `RootAction` property to `Root` in the `RecActionView` class to improve clarity and align with naming conventions. Updated the `ReadRecActionQueryHandler` class to reference the renamed property in its LINQ query, ensuring consistency between the data model and query logic.
This commit is contained in:
tekh 2025-12-04 14:46:30 +01:00
parent 3b6df031a6
commit 0f3fd320b0
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ public class ReadRecActionQueryHandler(IRepository<RecActionView> repo, IMapper
{ {
public async Task<IEnumerable<RecActionDto>> Handle(ReadRecActionQuery request, CancellationToken cancel) public async Task<IEnumerable<RecActionDto>> Handle(ReadRecActionQuery request, CancellationToken cancel)
{ {
var actions = await repo.Where(act => act.ProfileId == request.ProfileId).Where(act => act.RootAction!.OutRes != null).ToListAsync(cancel); var actions = await repo.Where(act => act.ProfileId == request.ProfileId).Where(act => act.Root!.OutRes != null).ToListAsync(cancel);
if(actions.Count == 0) if(actions.Count == 0)
throw new NotFoundException($"No actions found for the profile {request.ProfileId}."); throw new NotFoundException($"No actions found for the profile {request.ProfileId}.");

View File

@ -18,7 +18,7 @@ public class RecActionView
public required long Id { get; set; } public required long Id { get; set; }
[ForeignKey("Id")] [ForeignKey("Id")]
public RecAction? RootAction { get; set; } public RecAction? Root { get; set; }
[Column("PROFILE_ID")] [Column("PROFILE_ID")]
public long? ProfileId { get; set; } public long? ProfileId { get; set; }