AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Declaration of AddBusinessRules causes Overriding even when not implemented #516

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the Required() componentmodel.dataannotations attribute on a property 
for your editable class
2. Don't populate it
3. The business methods should include, as usual, the empty declaration of 
AddBusinessRules, to wit:
    Protected Overrides Sub AddBusinessRules()
   ' TODO: add validation rules
   'ValidationRules.AddRule(RuleMethod, NameProperty)
   End Sub

What is the expected output? What do you see instead?
The object will be Valid even though we expect it to be invalid, since the 
required element ins't populated.  But if you remove or comment out the empty 
declaratio
n of the method, the object will be InValid, as expected.
So we can conclude that if we want to permit the proper functioning of the 
DataAnnotations, we need to either eliminate the declaration of the 
AddBusinessRules method or include a call to the BaseMethod in its implemention.

What version of the product are you using?
CodeSmith 5.2.2 - CSLA 3.8.3.

Please provide any additional information below.

Original issue reported on code.google.com by RQJohnso...@gmail.com on 13 Oct 2010 at 4:41

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 13 Oct 2010 at 2:46

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2053.

Fixed Issue 516: Declaration of AddBusinessRules causes Overriding even when 
not implemented

Original comment by bniemyjski on 20 Nov 2010 at 12:35

GoogleCodeExporter commented 9 years ago
Hello,

This has been fixed in revision 2053 and can be downloaded here 
http://community.codesmithtools.com/nightly/CSLA/

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 20 Nov 2010 at 12:36