public bool tryFind(int id, out BookEvaluaion res) { if (Data.Count == 0) { res = null; return(false); } var result = from book in Data where book.BookID == id select book; if (result.Count() == 0) { res = null; return(false); } res = result.First(); return(true); }
/// <summary> /// 标准构造函数 /// </summary> /// <param name="info">教材属性</param> /// <param name="value">教材评价</param> public BookFinal(BookDetail info, BookEvaluaion value) { MainInfo = info; MainValue = value; }
public void ReplaceTo(int id, BookEvaluaion item) { var result = from book in Data where book.BookID == id select book = item.Clone(); }
public void Add(BookEvaluaion item) { Data.Add(item); }