Re: CSLA performance issues with large data sets

Re: CSLA performance issues with large data sets

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


JFernando posted on Tuesday, April 19, 2011

Normal 0 false false false EN-US X-NONE X-NONE

Per my understanding this codebase was initially setup by Magenic and the DataAccess in the BusinessObject is as follows

 

  private void Child_Fetch(AlertNotificationRecipientViewInfoDTO childData)

        {

            this.LoadProperties(childData);

        }

 

Which bubbles down to

 

protected void LoadProperties(object sourceBusinessObject)

        {

            string[] ignorelist = new string[0];

            LoadProperties(sourceBusinessObject, ignorelist);

        }

 

And

 

protected void LoadProperties(object sourceBusinessObject, params string[] ignoreList)

        {

            List<string> ignore = new List<string>(ignoreList);

 

            var listofRegisteredProperies = FieldManager.GetRegisteredProperties();

            foreach (var propertyName in GetPropertyNames(sourceBusinessObject.GetType()))

            {

                if (!ignore.Contains(propertyName))

                {

                    object value = MethodCaller.CallPropertyGetter(sourceBusinessObject, propertyName);

                    //This will avoid access to Modified Closure

                    string name = propertyName;

                    var pinfo = listofRegisteredProperies.Find(x => x.Name == name);

                    LoadProperty(pinfo, value);

                }

            }

        }

 

And now note the LoadProperty call.

Copyright (c) Marimer LLC