public static IEnumerable <T> Exclude <T>(this IEnumerable <T> t, NullObjectHandling nullHandler = NullObjectHandling.Include) { switch (nullHandler) { case NullObjectHandling.Include: return(t); default: return(t.Where(x => x.Exists())); } }
public void SetOnEmpty(NullObjectHandling n) => EmptyFormat = n;
public void SetInclusion(NullObjectHandling inclusion) => Inclusion = inclusion;
public OrderOptions WithInclusion(NullObjectHandling inclusion) { SetInclusion(inclusion); return(this); }
public async Task SetNullFormatAsync(NullObjectHandling value) // make a NullObjectHandling TypeReader. { }
public static IEnumerable <SocketGuildUser> ByHighestRole(this IEnumerable <SocketGuildUser> users, OrderDirection d = OrderDirection.Descending, NullObjectHandling n = NullObjectHandling.Include) => users.SortBy(x => x.Roles.GetHighestRole(), d, n);
public static IEnumerable <SocketGuildUser> ByMuteState(this IEnumerable <SocketGuildUser> users, OrderDirection d = OrderDirection.Descending, NullObjectHandling n = NullObjectHandling.Include) => users.SortBy(x => x.IsMuted, d, n);
public static IEnumerable <SocketGuildUser> ByPermissionValue(this IEnumerable <SocketGuildUser> users, OrderDirection d = OrderDirection.Descending, NullObjectHandling n = NullObjectHandling.Include) => users.SortBy(x => x.GuildPermissions.RawValue, d, n);
public static IEnumerable <TSource> SortBy <TSource, TKey>(this IEnumerable <TSource> t, Func <TSource, TKey> k, OrderDirection d = OrderDirection.Descending, NullObjectHandling n = NullObjectHandling.Include, bool?c = false) => t.SortBy(k, new OrderOptions(d, n, c));
public static IEnumerable <T> SortBy <T>(this IEnumerable <T> t, OrderDirection d, NullObjectHandling n, bool?c = null) => t.SortBy(new OrderOptions(d, n, c));