EF 取出demical数据,但需要去点小数,排序

try
            {
                BasePaperWeightDAL.Get(o => o.IsDeleted == false && o.IsEnabled == true).OrderByDescending(o => o.Sort).
                    ThenByDescending(o => o.CreateTime).ToList().ForEach(o =>
                    {
                        if (o.WeightValue != null)
                        {
                            o.WeightValue = Convert.ToInt32(o.WeightValue);
                        }
                        LstBasePaperWeight.Add(o);
                    });
            }
            catch (Exception ex)
            {
                
            }

  

原文地址:https://www.cnblogs.com/ouylvr0625/p/8004226.html