CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Forum has moved

New location: CSLA .NET forum


CSLA .NET Resources:
  • CSLA .NET forum
  • CSLA .NET home page
  • How to set child property into null value when the root object is initialize

    rated by 0 users
    Not Answered This post has 0 verified answers | 0 Replies | 1 Follower

    Not Ranked
    9 Posts
    sutono posted on Thu, Jun 16 2011 4:38 AM

    HI All,

    please someone tell me how to set child property into null value when the root object is initialize...

    i need this because of my specific business case, i have a parent object that contain a lot of editable child property inside, and sometimes user can fill in some of the child information (not all) thats why i need the validation at the root object to determine which child is not filled in.

    private static PropertyInfo<PDGravureSR> _PDGravureSRProperty = RegisterProperty<PDGravureSR>(p => p.PDGravureSR);

            public PDGravureSR PDGravureSR

            {

                get

                {

                    if (!(FieldManager.FieldExists(_PDGravureSRProperty)) || FieldManager.GetFieldData(_PDGravureSRProperty).Value == null)

                        LoadProperty(_PDGravureSRProperty, PDGravureSR.New(F_Id));

                    return GetProperty(_PDGravureSRProperty);

                }

            }

     

    i have this child property inside my root object, each time my root object was initialize, this property will always assigned by its default value, i know CSLA framework made this for "lazy loading" purpose, but is there any ways to set this child property into "null" when its initialize, so that i can have my validation on UI.

    Thx,

    Stone

    Page 1 of 1 (1 items) | RSS

    Copyright (c) 2006-2014 Marimer LLC. All rights reserved.
    Email admin@lhotka.net for support.
    Powered by Community Server (Non-Commercial Edition), by Telligent Systems