public static Messages_ReplyService instance() { if (_instance == null) { _instance = new Messages_ReplyService(); } return(_instance); }
public Messages Single(Guid id) { Messages result = new Messages(); _db.Execute(() => { result = _db.Single <Messages>(m => m.ID == id); }); result.ReplyItems = Messages_ReplyService.instance().GetTop(result.ID); result.Count++; this.Update(result); return(result); }
public IEnumerable <Messages> GetEnum(Guid cid, bool?isChild = true) { IEnumerable <Messages> result = new List <Messages>(); _db.Execute(() => { result = _db.GetList <Messages>(m => m.CompanyID == cid); }); if (isChild.Value) { result.Each(m => { m.ReplyItems = Messages_ReplyService.instance().GetTop(m.ID); }); } return(result); }