@@ -2,7 +2,6 @@ namespace Rules.Framework
22{
33 using System ;
44 using System . Collections . Generic ;
5- using System . Linq ;
65 using Rules . Framework . Core ;
76
87 /// <summary>
@@ -21,7 +20,7 @@ private RulesEngineOptions()
2120 public IDictionary < DataTypes , object > DataTypeDefaults { get ; }
2221
2322 /// <summary>
24- /// Gets or sets wether rules' conditions is enabled or not.
23+ /// Gets or sets whether rules' conditions is enabled or not.
2524 /// </summary>
2625 public bool EnableCompilation { get ; set ; }
2726
@@ -57,7 +56,7 @@ public PriorityCriterias PriotityCriteria
5756 /// </summary>
5857 /// <remarks>
5958 /// <para>MissingConditionBehavior = UseDataTypeDefault</para>
60- /// <para>PriotityCriteria = TopmostRuleWins</para>
59+ /// <para>PriorityCriteria = TopmostRuleWins</para>
6160 /// <para>DataTypes.Boolean default = default(bool)</para>
6261 /// <para>DataTypes.Decimal default = default(decimal)</para>
6362 /// <para>DataTypes.Integer default = default(int)</para>
@@ -66,21 +65,23 @@ public PriorityCriterias PriotityCriteria
6665 /// <returns></returns>
6766 public static RulesEngineOptions NewWithDefaults ( )
6867 {
69- RulesEngineOptions rulesEngineOptions = new RulesEngineOptions
68+ RulesEngineOptions rulesEngineOptions = new ( )
7069 {
7170 MissingConditionBehavior = MissingConditionBehaviors . UseDataTypeDefault ,
72- PriorityCriteria = PriorityCriterias . TopmostRuleWins
71+ PriorityCriteria = PriorityCriterias . TopmostRuleWins ,
72+ DataTypeDefaults =
73+ {
74+ [ DataTypes . Boolean ] = default ( bool ) ,
75+ [ DataTypes . Decimal ] = default ( decimal ) ,
76+ [ DataTypes . Integer ] = default ( int ) ,
77+ [ DataTypes . String ] = string . Empty ,
78+ [ DataTypes . ArrayBoolean ] = default ( bool ) ,
79+ [ DataTypes . ArrayDecimal ] = default ( decimal ) ,
80+ [ DataTypes . ArrayInteger ] = default ( int ) ,
81+ [ DataTypes . ArrayString ] = string . Empty ,
82+ } ,
7383 } ;
7484
75- rulesEngineOptions . DataTypeDefaults [ DataTypes . Boolean ] = default ( bool ) ;
76- rulesEngineOptions . DataTypeDefaults [ DataTypes . Decimal ] = default ( decimal ) ;
77- rulesEngineOptions . DataTypeDefaults [ DataTypes . Integer ] = default ( int ) ;
78- rulesEngineOptions . DataTypeDefaults [ DataTypes . String ] = string . Empty ;
79-
80- rulesEngineOptions . DataTypeDefaults [ DataTypes . ArrayBoolean ] = Enumerable . Empty < bool > ( ) ;
81- rulesEngineOptions . DataTypeDefaults [ DataTypes . ArrayDecimal ] = Enumerable . Empty < decimal > ( ) ;
82- rulesEngineOptions . DataTypeDefaults [ DataTypes . ArrayInteger ] = Enumerable . Empty < int > ( ) ;
83- rulesEngineOptions . DataTypeDefaults [ DataTypes . ArrayString ] = Enumerable . Empty < string > ( ) ;
8485
8586 return rulesEngineOptions ;
8687 }
0 commit comments