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

Checking IsDirty at the property level in a business rule

Last post 05-07-2008, 9:21 PM by RockfordLhotka. 1 replies.
Sort Posts: Previous Next
  •  05-06-2008, 12:59 PM 23366

    Checking IsDirty at the property level in a business rule

    Hello,

    I would like to be able to get property metadata like IsDirty in a business rule to validate someone has changed it prior to running the rule logic.  I am using CSLA 3.5.  

    At one point I was using

    Csla.Core.FieldManager.IFieldData dataPointValue = target.FieldManager.GetFieldData(DataPointValueProperty);

    if (dataPointValueIsDirty)

    ...

    But that seems to have been removed in the latest version of 3.5.   Is this something the business rule already knows and doesn't fire if the property hasn't been changed?

    A scenario would be someone unchecks a checkbox in the UI, the business rule checks to see if you can set that property to false based on business logic related to other fields in the DB.

    Thanks!

    Mike

  •  05-07-2008, 9:21 PM 23427 in reply to 23366

    Re: Checking IsDirty at the property level in a business rule

    This is a known problem and is on the wish list.

    Exposing the FieldData object like I did in the beta was a problem because it allowed outside code to change the FieldData object's values - and that would have been a mess.

    But in restricting access to the object I missed the fact that the IsDirty value needs to be available Sad [:(]

    Once I get done with my current bit of non-stop travel I'll address this, probably in a 3.5.2 version.


    Rocky
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