Can you provide a good example of rule definition language written in C#.
Java guys have JESS, is there anything good for C#?

- 116,545
- 46
- 111
- 131

- 122,288
- 32
- 173
- 203
-
This article can help http://www.codeproject.com/KB/aspnet/buisness-rules-asp-net.aspx – Aug 19 '11 at 15:02
7 Answers
This page shows some examples of open-source rules engines in C#: http://csharp-source.net/open-source/rule-engines

- 94,284
- 15
- 101
- 152
You can use the forward chaining inference engine that is part of Windows Workflow Foundation (.NET 3.5 and higher) The best part is that this has a free runtime licensing.
You can use the Rule Manager from Acumen Business and install the Windows Workflow Foundation adapter. Once installed, export the rules as WFRules (*.rules). A visual studio .NET solution will be generated that shows how the rule engine can be invoked standalone (no workflow is necessary)
See also http://bizknowledge.blogspot.com/search/label/Windows%20Workflow%20Foundation

- 2,185
- 2
- 19
- 20
Try http://rulesengine.codeplex.com It has a fluent-interface wrapper for creating rules. It's lightweight and simple to use.

- 430
- 1
- 3
- 13
-
1I wouldn't call this a rules engine IMO. It's more like a validation engine. – AaronLS Jul 12 '12 at 07:55
You could use Windows Workflow Foundation's (WF) workflow engine with C#. I'd started a small and simple project using WF as the workflow engine, it's actually quite straightforward to use. Check out the first part entry I've been developing on this here.
What is interesting about WF is that you don't have to use the whole thing if you want to - if you only want to write some custom rules against some entities or objects, you can - quite ingenious! Also, it's a lot less to take on board than BizTalk's BRE (and no licensing cost).
You need to add a reference to the following .Net assemblies, available in the .Net Framework v3.0 and onwards:
- System.Workflow.Activities
- System.Workflow.ComponentModel
- System.Workflow.Runtime
Check out the article for more info.

- 9,382
- 3
- 35
- 63
Microsoft Business Rule Engine(BRE) is quite nice. But(and that's a big BUT) you'll need a BizTalk Server license to use it.
There is the Microsoft Business Rules Engine: http://msdn.microsoft.com/en-us/library/aa561216.aspx. Not sure if it can only be used inside Biztalk - it does says it is a .Net Class Library.

- 56,243
- 7
- 59
- 69
-
It can be used outside BizTalk, but you need a valid BizTalk License. – HashName Jul 19 '10 at 21:16