我有以下课程:
class Device
{
[AutoIncrement]
public int Id { get; set; }
public string Brand { get; set; }
public string Name { get; set; }
public string Price { get; set; }
public DeviceType Type { get; set; }
public Screen Display { get; set; }
}
enum DeviceType
{
Mobile, Tablet
};
class Screen
{
public List<string> Options { get; set; }
}
我可以这样做插入数据,
db.Insert(new Device { Name = "IPad2", Brand = "Apple", Price = "£450", Type = DeviceType.Tablet, Display = new Screen { Options = new List<string> { "opt1", "opt2", "opt3"} } });
并将显示数据添加到Display
列中{Options:[opt1,opt2,opt3]}
。现在我无法开始编写后续查询。
SELECT * FROM Device WHERE Display option "opt1" ;
请帮忙。