1
.第一种方式 if(partsSalesOrderTypes.GroupBy(entity => new { entity.Name, entity.Code }).Any(array => array.Count() > 1)) { /*违反多字段唯一时,提示信息处理*/ return; } 2.第二种方式 var groupPrice = from price in this.PartsSpecialTreatyPrices group price by new { price.DealerId, //分组字段 price.PartsSalesCategoryId, //分组字段 price.SparePartId //分组字段 } into groups select new { count = groups.Count(), key = groups.Key }; if(groupPrice.Any(group => group.count > 1)) { /*违反多字段唯一时,提示信息处理*/ }

相关文章:

  • 2021-05-05
  • 2021-12-27
  • 2021-05-21
  • 2021-08-22
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
猜你喜欢
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
相关资源
相似解决方案