/// <summary> /// 领取教材的数量 /// </summary> /// <param name="textbookId"></param> /// <returns></returns> public int ReleaseCount(Guid textbookId) { var records = ReleaseRecords.Where(t => t.Textbook_Id == textbookId); if (records == null || records.Count() == 0) { return(0); } else { var count = records.Sum(t => t.ReleaseCount); return(count); } }
/// <summary> /// 是否领过教材 /// </summary> /// <param name="textbook"></param> /// <returns></returns> public bool HasTextbook(Guid textbookId) { var result = ReleaseRecords.FirstOrDefault(t => t.Textbook_Id == textbookId); return(result == null ? false : true); }