AspNetCore.IQueryable.Extensions
AspNetCore.IQueryable.Extensions copied to clipboard
Filtro não funciona com propriedade em objetos de valor
Como resolver, pois quando o campo que deseja filtrar está em um objeto de valor da entidade, o filtro não funciona.
public class AuditQuery : ICustomQueryable, IQueryPaging, IQuerySort { [QueryOperator(Operator = WhereOperator.Equals, HasName = nameof(CareInfo.InsurerReferenceNumber))] public string? InsurerReferenceNumber { get; set; } [QueryOperator(Operator = WhereOperator.Contains, HasName=nameof(Audit.Type))] public List<AuditType>? Types { get; set; } [QueryOperator(Operator = WhereOperator.Contains, HasName=nameof(Audit.Status))] public List<AuditStatus>? Statuses { get; set; } public Guid? TeamId { get; set; } public int? Limit { get; set; } = 25; public int? Offset { get; set; } = 0; public string Sort { get; set; } = nameof(Audit.AuditDeadline); }
public class Audit : Entity, IAggregateRoot {
public DateTime RecordDate { get; private set; }
public DateTime AuditDeadline { get; private set; }
public RequestSource Source { get; private set; }
public string SourceId { get; private set; }
public AuditType Type { get; private set; }
public BeneficiaryInfo BeneficiaryInfo { get; private set; }
public CareInfo CareInfo { get; private set; }
public bool IsRetrospective { get; private set; }
public bool IsInsistence { get; private set; }
public int InsistenceSequence { get; private set; }
....
}
public class CareInfo { public EventType EventType { get; private set; } public string InsurerReferenceNumber { get; private set; } public string OriginReferenceNumber { get; private set; } public DateTime CareDate { get; private set; } public RequestOrigin RequestOrigin { get; private set; } }