Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nhibernate 含有异丁苯甲酸酯_Nhibernate_Fluent Nhibernate - Fatal编程技术网

Nhibernate 含有异丁苯甲酸酯

Nhibernate 含有异丁苯甲酸酯,nhibernate,fluent-nhibernate,Nhibernate,Fluent Nhibernate,我有一门课: public class Author : Entity { public virtual string ForeName { get; set; } public virtual string LastName { get; set; } public Author() { } } 以及另一个X类,包含: public virtual IList<Author> Authors { get; set; } 公共虚拟IList作者{get;

我有一门课:

public class Author : Entity
{
    public virtual string ForeName { get; set; }
    public virtual string LastName { get; set; }

    public Author() { }
}
以及另一个X类,包含:

public virtual IList<Author> Authors { get; set; }
公共虚拟IList作者{get;set;}

覆盖Author中的Equals方法是确定X是否已经包含作者的最佳方法吗?

如果您有作者列表,对我来说,搜索的最佳方法是字典:

var auditors = list.ToDictionary<IdType, Author>(key => key.Id, value => value)
Auditor auditor;
if(auditors.ContainsKey(key))
{
   auditor = auditors[key];
}

如果你有作者名单,对我来说,最好的搜索方式是字典:

var auditors = list.ToDictionary<IdType, Author>(key => key.Id, value => value)
Auditor auditor;
if(auditors.ContainsKey(key))
{
   auditor = auditors[key];
}