예제 #1
0
        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);
        }
예제 #2
0
 /// <summary>
 /// 标准构造函数
 /// </summary>
 /// <param name="info">教材属性</param>
 /// <param name="value">教材评价</param>
 public BookFinal(BookDetail info, BookEvaluaion value)
 {
     MainInfo  = info;
     MainValue = value;
 }
예제 #3
0
 public void ReplaceTo(int id, BookEvaluaion item)
 {
     var result = from book in Data
                  where book.BookID == id
                  select book = item.Clone();
 }
예제 #4
0
 public void Add(BookEvaluaion item)
 {
     Data.Add(item);
 }