using Admin.Core.IRepository; using Admin.Core.Service; using Admin.Core.IService; using Admin.Core.Model; using System.Collections.Generic; using System.Linq; using System; namespace Admin.Core.Service { public class LR_weighServices : BaseServices, ILR_weighServices { private readonly IBaseRepository _dal; public LR_weighServices(IBaseRepository dal) { this._dal = dal; base.BaseDal = dal; } public List GetRecentWeightList(string planCode) { try { List list = _dal.Query(x => x.Plan_ID == planCode).ToList(); int maxMainID = list.Max(x => x.MainId); List groupList = list.Where(x => x.MainId == maxMainID).ToList(); return groupList; } catch { throw; } } } }