I have an excel with the number of records. I want to apply Nrule on it. I want to match two rows and apply rules on them and check whether it is breaking it or not. for example :
Id | Date | Desc |
---|---|---|
1 | 12/31/21 | Somethings |
1 | 12/31/21 | Anything |
2 | 1/1/22 | Lorem Epsum |
Rule : "Somethings" and "Anything" should not come on same date.
Hence, here it is breaking a rule. How to right it in NRule?
If Excel file is a CSV, you can use CsvHelper to read the data into a domain model. If it's truly an Excel document, there are articles on SO outlining how to load data from Excel.
Using CsvHelper and NRules, here is one way how to load the data and implement the requested rule.