のこの他の結果セットにある場合、私はBuildingPrice.ShedStyle
プロパティがShedStyles.Where(...)
LINQ - 特定のプロパティがプロパティのタイプ
var prices = db.BuildingPrices.Where(
p => p.ShedStyle.IsAmong(//There must be some obvious method for this
db.ShedStyles.Where(s => s.Name.Contains("text")
);
public class BuildingPrice
{
public ShedStyle ShedStyle { get; set; }
}
public class ShedStyle
{
public string Name { get; set; }
}
public class Context : DbContext
{
public DbSet<BuildingPrice> BuildingPrices { get; set; }
public DbSet<ShedStyle> ShedStyles { get; set; }
}
BrokenGlassは、オブジェクトを介してこれを直接クエリする方が表現力のあるアプローチになります。 –
これまでのところ、文字列に 'Contains'を使用していただけで、想像上の' IsAmong'拡張 – Benjamin