C#
- 2 ответа
- 0 вопросов
1
Вклад в тег
internal class Soldier
{
public virtual string Attack() => "Shoot from gun";
}
internal class CoolerSoldier : Soldier
{
public override string Attack() => base.Attack() + " and throw a grenade";
}
internal class ManInBlack : Soldier
{
public new virtual string Attack() => "Shoot from blaster";
}
internal class ManInBlackBoss : ManInBlack
{
public override string Attack() => base.Attack() + " and call an army of aliens";
}
List<int> cataegoryIDs= ... // коды обязательных категорий
List<int> tagIDs= ... // коды обязательных тегов
var pubs = ctx.Pubs.Where(p => p.Categories.All(c => categoryIDs.Contains(c.ID)) && p.Tags.All(t => tagIDs.Contains(t.ID)));