Add Get endpoint and refactor ReadRecActionQuery
Added a new Get endpoint to RecActionController to fetch data based on profileId using ReadRecActionQuery. Updated ReadRecActionQuery to support long ProfileId, added a parameterless constructor, and refactored its structure. Adjusted ReadRecActionQueryHandler to align with these changes.
This commit is contained in:
@@ -10,12 +10,17 @@ namespace ReC.Application.RecActions.Queries;
|
||||
|
||||
public record ReadRecActionQueryBase
|
||||
{
|
||||
public int ProfileId { get; init; }
|
||||
public long ProfileId { get; init; }
|
||||
|
||||
public ReadRecActionQuery ToReadQuery() => new(this);
|
||||
}
|
||||
|
||||
public record ReadRecActionQuery(ReadRecActionQueryBase Root) : ReadRecActionQueryBase(Root), IRequest<IEnumerable<RecActionDto>>;
|
||||
public record ReadRecActionQuery : ReadRecActionQueryBase, IRequest<IEnumerable<RecActionDto>>
|
||||
{
|
||||
public ReadRecActionQuery(ReadRecActionQueryBase root) : base(root) { }
|
||||
|
||||
public ReadRecActionQuery() { }
|
||||
}
|
||||
|
||||
public class ReadRecActionQueryHandler(IRepository<RecActionView> repo, IMapper mapper) : IRequestHandler<ReadRecActionQuery, IEnumerable<RecActionDto>>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user