>The Business Layer Generator creates a business rule for each non-nullable numeric data type and uses mmType.IsEmpty() to test if the field is equal to 0. If it is 0, then it considers it a broken rule.
>bout half of my numeric fields can have 0 as a legitimate value so the automatically generated business rule is a problem for me. I have been commenting out these business rules, but it's becoming a hassle to maintain when I recreate the business objects.
>Is there a way to prevent these rules from automatically generating so I don't have to comment them out or is there a way for me to override them using the partial class? I don't believe the latter is possible, but may there is a way.
>Thanks,
>Al
Al,
If you select the "Allow Empty Value" checkbox along with the "Required" checkbox in the BLG, MM will generate a business rule using mmType.IsEmpty(value, true). This overload of the method will allow empty values (empty strings and zero values) but not nulls.
Greg Lee
GCL Software