【发布时间】:2015-10-24 13:42:06
【问题描述】:
我的 POCO 对象;
public class Chest
{
public Chest()
{
this.KeyIds = new List<string>();
this.Keys = new List<Page>();
}
public string Id { get; set; }
public string Name { get; set; }
[JsonIgnore]
public IList<Key> Keys { get; set; }
public IList<string> KeyIds { get; set; }
}
public class UserKey
{
public string UserName { get; set; }
public string Id { get; set; }
public UserKey()
{
this.KeyIds = new List<string>();
}
public IList<string> KeyIds { get; set; }
}
我想要我的用户键拥有的箱子。
例如:用户的 KeyIds=1,2,3
并且有这样的宝箱:
Chest1:名称:Hollywood,KeyIds=1
Chest2:Name:Mollywood, KeyIds=2
Chest3:Name:Barcelona, KeyIds=1,2
Chest4:Name:Madrid, KeyIds=1,2,3
Chest5:Name:Dortmund, KeyIds=4
Chest6:Name:Milano, KeyIds=4,5
我将用户名作为参数提供给查询,结果应该返回给我
Chest1、Chest2、Chest3、Chest4 对象。
谢谢。问候
【问题讨论】: