예제 #1
0
 public static IQueryable <DeletedMessageEntity> FilterBy(this IQueryable <DeletedMessageEntity> query, DeletedMessageSearchCriteria criteria)
 => query
 .FilterBy(
     x => x.GuildId == criteria.GuildId,
     criteria?.GuildId != null)
 .FilterBy(
     x => x.ChannelId == criteria.ChannelId,
     criteria?.ChannelId != null)
 .FilterBy(
     x => x.Channel.Name.OrdinalContains(criteria.Channel),
     !string.IsNullOrWhiteSpace(criteria?.Channel))
 .FilterBy(
     x => x.AuthorId == criteria.AuthorId,
     criteria?.AuthorId != null)
 .FilterBy(
     x => (x.Author.Nickname ?? $"{x.Author.User.Username}#{x.Author.User.Discriminator}").OrdinalContains(criteria.Author),
     !string.IsNullOrWhiteSpace(criteria?.Author))
 .FilterBy(
     x => x.CreateAction.CreatedById == criteria.CreatedById,
     criteria?.CreatedById != null)
 .FilterBy(
     x => (x.CreateAction.CreatedBy.Nickname ?? $"{x.CreateAction.CreatedBy.User.Username}#{x.Author.User.Discriminator}").OrdinalContains(criteria.CreatedBy),
     !string.IsNullOrWhiteSpace(criteria?.CreatedBy))
 .FilterBy(
     x => x.Content.OrdinalContains(criteria.Content),
     !string.IsNullOrWhiteSpace(criteria?.Content))
 .FilterBy(
     x => x.Reason.OrdinalContains(criteria.Reason),
     !string.IsNullOrWhiteSpace(criteria?.Reason))
 .FilterBy(
     x => x.BatchId == criteria.BatchId,
     criteria?.BatchId != null);
예제 #2
0
 public static IQueryable <DeletedMessageEntity> FilterBy(this IQueryable <DeletedMessageEntity> query, DeletedMessageSearchCriteria criteria)
 => query
 .FilterBy(
     x => x.GuildId == criteria.GuildId,
     criteria?.GuildId != null)
 .FilterBy(