0
I have the entity MessageEntity
which contains several sessions (SectionsEntity
) which in turn contains several calls (TreatmentEntity
).
I need to bring the messages, filtered by your Id
, filtered by active sessions and active calls.
Follows the entities:
public class MessageEntity: AggEntity
{
....
public MessageEntity()
{
}
public virtual ICollection<SectionsEntity> Sections { get; private set; }
...
}
public class SectionsEntity : AggEntity
{
...
public SectionsEntity() { }
..
public virtual ICollection<TreatmentEntity> Treatments { get; private set; } = new List<TreatmentEntity>();
public DateTime? FinishAt { get; private set; }
}
public class TreatmentEntity : AggEntity
{
...
public AttendanceEntity()
{
}
public DateTime? FinishAt { get; private set; }
....
}
I have an extension class that returns to Messageentity:
public static IQueryable<MessageEntity> ActiveSectionsByMessageId(this IQueryable<MessageEntity> source, Guid id)
{
return source.Where(x => x.Id == id)
}
How to bring only the Message
that has the fields FinishAt == null
?
Thank you very much
This query is a bit strange... you speak in message and present the query method in
Chat
an entity you didn’t even present– Leandro Angelo
@Leandroangelo edited, thank you
– Henrique