Skip to content

Commit

Permalink
EFC linq parser = poop
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiao921 committed Jul 29, 2020
1 parent 8e9c602 commit 5d83d76
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions CHEF/Components/Commands/Ignore/Ignore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,16 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)

public async Task<Ignore> GetIgnore(ulong discordId) =>
await UserIds.AsQueryable()
.FirstOrDefaultAsync(i => i.Equals(discordId));
.FirstOrDefaultAsync(i => i.DiscordId == discordId);


public async Task<bool> IsIgnored(SocketUser user) =>
await UserIds.AsQueryable().AnyAsync(i => i.Equals(user));
await UserIds.AsQueryable().AnyAsync(i => i.DiscordId == user.Id);
}

public class Ignore
{
[Key]
public ulong DiscordId { get; set; }

public bool Equals(ulong discordId)
{
return DiscordId == discordId;
}

public bool Equals(SocketUser user)
{
return DiscordId == user.Id;
}
}
}

0 comments on commit 5d83d76

Please sign in to comment.