Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Generated Business Rules for Numeric Columns
Message
From
23/02/2009 15:38:23
 
 
To
19/02/2009 22:27:57
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01383003
Message ID:
01383581
Views:
49
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform