【发布时间】:2013-01-17 13:25:08
【问题描述】:
我对 linq 完全陌生,需要帮助。 这些是我的 poco 课程:
public class User {
public User()
{
this.Profiles = new List<Profile>();
}
public Guid ID { get; set; }
public bool IsValid{ get; set; }
public virtual ICollection<Profile> Profiles { get; set; }
}
public class Profile {
public Profile() {
this.Users = new List<User>();
this.Customers = new List<Customer>();
}
public Guid ID { get; set; }
public string Name { get; set; }
public virtual ICollection<User> Users { get; set; }
public virtual ICollection<Customer> Customers { get; set; }
}
public class Customer {
public Customer()
{
this.Profiles = new List<Profile>();
}
public Guid ID { get; set; }
public string Number { get; set; }
public virtual ICollection<Profile> Profiles { get; set; }
}
我想搜索有特殊客户的有效用户。特殊客户将来自另一个用户。所以我会发送另一个用户作为方法参数。
是否可以使用 linq 或者我需要存储过程来解决问题?
最好的问候
【问题讨论】:
-
请尝试更好地描述您的问题。你能发布例如您正在尝试编写的方法的一些伪代码(可能的输入和预期的输出)?
-
@mipe34 嗨,列表
user = FindAllUsersBySameCustomers(User sourceuser);我想要一个具有与方法中提供的相同客户的用户列表。希望对你有帮助