Problem with "Insert Business Regions" Snippet?

Problem with "Insert Business Regions" Snippet?

Old forum URL: forums.lhotka.net/forums/t/187.aspx


BBM posted on Wednesday, May 24, 2006

I just tried to use the "Insert Business Regions" code snippet (CSLA 2.0, VB).   The class into which I'm inserting Inherits from BusinessBase(of T).  The following code gets inserted...

#Region " Validation Rules "

Protected Overrides Sub AddValidationRules()

' TODO: add validation rules

End Sub

#End Region

The VB background compiler complains that AddValidationRules() cannot be Overrides because it doesn't override a sub in the base class

Sure enough, CSLA.Core.BusinessBase doesn't define an AddValidationRules() but it defines an overridable sub AddBusinessRules(), and it's used in the BusinessBase constructors, etc.  I'm assuming the snippet is wrong?

ajj3085 replied on Wednesday, May 24, 2006

This is a known issue; the code changed, but the snippit wasn't updated.   You can download the fix or modify the snippit yourself.

HTH
Andy

BBM replied on Wednesday, May 24, 2006

Hi Andy,

Thanks for your response.

I couldn't find that it was known.  I  searched this forum, and looked at the change notes for CSLA ver 2.01  (haven't downloaded ver 2.01 yet).

Is there someplace else I should have looked?

BBM

PS.  I really think that AddValidationRules() is more descriptive, but I understand it makes for more changes when porting to Ver 2.0.

ajj3085 replied on Wednesday, May 24, 2006

I thought I saw an errata or post here about this issue.  Thats how I know the answer, even though I don't use VB (the C# snippit is correct, I think.  I actually don't use snippits).

Andy

RockfordLhotka replied on Wednesday, May 24, 2006

That is fixed in 2.0.1 - I just forgot to add it to the change log (I did now though).

Copyright (c) Marimer LLC