Files
predavanja/Events-WebApi/Events.WebAPI.Contract/Queries/Generic/GetCountQuery.cs
2026-05-10 23:39:55 +02:00

20 lines
428 B
C#

using MediatR;
namespace Events.WebAPI.Contract.Queries.Generic;
public abstract class GetCountQuery : IRequest<int>
{
public string? Filters { get; set; }
}
public class GetCountQuery<TDto> : GetCountQuery
{
public static GetCountQuery<TDto> CreateForPK<TPK>(TPK id) where TPK : IEquatable<TPK> {
var query = new GetCountQuery<TDto>()
{
Filters = $"id=={id}"
};
return query;
}
}