var _setList = (from f in _postgreDbContext.settlements group f by ( new { f.settlement_code })into g select new { deal_time = g.Max(m => m.deal_time), g.Key.settlement_code }).AsNoTracking().ToList();
var _setList = (from f in _postgreDbContext.settlements group f by ( new { f.settlement_code })into g select new { deal_time = g.Max(m => m.deal_time), g.Key.settlement_code }).AsNoTracking().ToList();