I have the following code which returns IList<>
var productCodes = await ProductsService.GetAllProductsAsync();
My Model:
public int ProductStartCode { get; set; }
public int ProducEndCode { get; set; }
When create a new product code range, I would like to check the new code doesn't overlap with the existing Product codes
My Product code looks like as follows:
ProductStartCode ProductEndCode
100001 100003
100004 100008
100009 100011
What I am trying to accomplish I need to check,
For example if I enter: 100001, 100002, 100003 are overlapping since they in between 100001 & 100002 range,
100004, 100005, 100006, 100007,100008 are also overlapping since they in between 100004 & 100008 range,
question from:
https://stackoverflow.com/questions/65835171/how-can-i-check-a-value-is-in-a-range-in-ilist 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…