initial commit

This commit is contained in:
2026-07-21 14:14:44 +07:00
commit fa7dbb970d
1359 changed files with 104110 additions and 0 deletions
@@ -0,0 +1,35 @@
using Indotalent.Infrastructure.Database;
using MediatR;
using Microsoft.EntityFrameworkCore;
namespace Indotalent.Features.Utilities.ProgramResource.Cqrs;
public class GetProgramResourceListResponse
{
public string? Id { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
}
public record GetProgramResourceListQuery() : IRequest<List<GetProgramResourceListResponse>>;
public class GetProgramResourceListHandler : IRequestHandler<GetProgramResourceListQuery, List<GetProgramResourceListResponse>>
{
private readonly AppDbContext _context;
public GetProgramResourceListHandler(AppDbContext context) => _context = context;
public async Task<List<GetProgramResourceListResponse>> Handle(GetProgramResourceListQuery request, CancellationToken cancellationToken)
{
return await _context.ProgramManagerResource
.AsNoTracking()
.OrderBy(x => x.Name)
.Select(x => new GetProgramResourceListResponse
{
Id = x.Id,
Name = x.Name,
Description = x.Description
})
.ToListAsync(cancellationToken);
}
}