public static List<GCountryExtend> GetList()
        {
            try
            {
                var result = new List<GCountryExtend>();
                using (ServiceManager<IGCountry> sm = new ServiceManager<IGCountry>())
                {
                    result = sm.Service.GetExtendListByWhere(string.Empty);
                    //处理中国优先在第一位
                    if (result.ExistsData() && result.Count>1)
                    {
                        var index = result.FindIndex(x=>x.CountryNameL=="中國");
                        if (index>0)
                        {
                            var firstCountry = result[0];
                            var china = result[index];
                            result[index] = firstCountry;
                            result[0] = china;
                        }
                       
                    }
                }
                return result;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

  

相关文章:

  • 2021-12-07
  • 2021-07-04
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2021-08-08
  • 2021-09-11
  • 2021-08-06
猜你喜欢
  • 2022-12-23
  • 2021-05-21
  • 2022-12-23
  • 2022-03-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案