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 MaterialName) { try { List list = _dal.Query(x => x.Material_Name == MaterialName).ToList(); if (list == null && list.Count == 0) { return new List(); } int maxMainID = list.Max(x => x.MainId); List groupList = list.Where(x => x.MainId == maxMainID).ToList(); return groupList; } catch { return new List(); } } } }