Mark newly created object as InValid

Mark newly created object as InValid

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


vijay posted on Wednesday, May 07, 2008

Hello,

What is the best way of marking newly created object, with blank values, as InValid. Is calling ValidationRules.CheckRules() is the only way or do we have something like Object.MarkInvalid.

Thanks

sergeyb replied on Wednesday, May 07, 2008

You typically always call ValidationRules.CHeckRules in DataPortal_Create or private constructor.

 

Sergey Barskiy

Senior Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: vijay [mailto:cslanet@lhotka.net]
Sent: Wednesday, May 07, 2008 8:23 AM
To: Sergey Barskiy
Subject: [CSLA .NET] Mark newly created object as InValid

 

Hello,

What is the best way of marking newly created object, with blank values, as InValid. Is calling ValidationRules.CheckRules() is the only way or do we have something like Object.MarkInvalid.

Thanks



JonnyBee replied on Thursday, May 08, 2008

Hi,

An object is InValid when ValidationRules.BrokenRulesCollection.count > 0 so yes - you must call ValidationRules.CheckRules()

/jonny

vijay replied on Thursday, May 08, 2008

OK, if that is the only way then it is fine.

Thanks for replies.

Copyright (c) Marimer LLC