CSLA .NET

From Rockford Lhotka's Expert C# 2005 and VB 2005 Business Objects books

Welcome to CSLA .NET Sign in | Join | Help
in Search

Mark newly created object as InValid

Last post 05-08-2008, 7:19 AM by vijay. 3 replies.
Sort Posts: Previous Next
  •  05-07-2008, 7:23 AM 23386

    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

  •  05-07-2008, 7:30 AM 23387 in reply to 23386

    RE: Mark newly created object as InValid

    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



  •  05-08-2008, 3:22 AM 23432 in reply to 23386

    Re: Mark newly created object as InValid

    Hi,

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

    /jonny
  •  05-08-2008, 7:19 AM 23433 in reply to 23386

    Re: Mark newly created object as InValid

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

    Thanks for replies.

View as RSS news feed in XML

Please contact Magenic for your .NET consulting and CSLA .NET mentoring needs.
Please consider making a donation to help support the ongoing development of CSLA .NET.

Make donation through PayPal - it's fast, free and secure!
Why donate?
Powered by Community Server, by Telligent Systems