Open GoogleCodeExporter opened 9 years ago
Hello Shannon,
What I did for my convenience is to add on the constructor of the entity a new
method
where you can add the validation rules for each entity. This way, by modifying
the
template of the entities.generated.cs, you can create the validation rules for
string
required, regex, minlenght, maxlenght, etc according to the column involved.
You can
iterate through the property AllowDBNull for each column to verify if it is a
required field or if you have to assign a minimum or maximum lenght to the
specific
field (same process as in the entity.aspx template for the maxlength on
textboxes).
Then, once you create an instance of an entity, all of the validation rules
will be
added to the new entity and just by checking Entity.Validate() you will have
every
broken rule (if broken) at a blink of an eye.
Hope this few lines helped you develop a suitable solution for your needs, I
did it
this way and now it is working as expected. I am now working on extending the
properties for the columns to add custom validation from the very begining (like
regex for specific fields), when you select the properties for nettiers.cst. :)
Regards,
DiegoGravi
Original comment by diegogr...@gmail.com
on 21 Aug 2008 at 12:20
[deleted comment]
Shanon - I would be keen to see what yoe have done to the templates. I am
needign to
do something similar, and it would be very handy to see how you did it. Would
it be
possible to get a copy of your changes?
Cheers
Paul Smith
psmith@pcug.org.au
Original comment by s...@pcug.org.au
on 4 Nov 2008 at 11:43
Paul,
I'm happy to share my changes, but I'm unsure of the best way to do this. My
changes
are based on what I think is v2.2.0.711 ( a tad old now).
Original comment by shanon.m...@gmail.com
on 5 Nov 2008 at 1:00
Shanon,
Create a patch.
Upgrade to rev 715 and then reapply your patch as the folder was moved.
From there all you have to do is hit the update button and update to the latest
revision.
Original comment by bniemyjski
on 8 Dec 2008 at 6:09
Shanon,
If you submit your patch, I will upgrade it to the latest version.
Original comment by bniemyjski
on 3 Feb 2009 at 2:40
OK then. What is the best tool to use to make a patch? I usually use araxis for
my
comparing/merging needs, but it doesnt seem to have any kind of make patch
option...
Original comment by shanon.m...@gmail.com
on 3 Feb 2009 at 3:23
I would pull down the same revision via svn and then drag your files over. From
here
right click in the root directory and make a patch via svn.
-Blake
Original comment by bniemyjski
on 3 Feb 2009 at 3:56
Original comment by bniemyjski
on 25 May 2009 at 3:18
Original comment by bniemyjski
on 25 May 2009 at 3:30
I too would like to see this enhancement. Validation rules on a subset or
superset of
entities is a very important feature. I found myself needing this and realized
the
solution I came up with was no where near optimal. IS there some guidance on
this
though, I can see the need for entities to validate themselves for data rules,
but for
business rules aggregates and set validation seems a no brainer for the service
tier in
this model. Am I wrong?
Original comment by EAI.Fr...@gmail.com
on 26 Jan 2010 at 6:44
I'M working just right now in a project that requires execute business rules in
the entities. The problem here is that modules in my project correspond to one
specific entity (i.e: PurchaseEntity -> Purchases Module). This modules are
generated at run time based in one specific interface in the assembly. Now, I
need to load the custom rules or business rules to be validated when the entity
require it (at Save time for say something). This business rules I'm thinking
placed into separate assembly with Processor class or maybe one XML file that
contains the assembly and the type to be instantiated at run time... this is my
approach.
Regards
César F. Qüeb Montejo
MJJ Brilliant, Inc
Original comment by cesar.q...@gmail.com
on 2 Feb 2012 at 5:16
Original issue reported on code.google.com by
shanon.m...@gmail.com
on 1 Jun 2008 at 5:50