Request - make IFieldData values accessible to BusinessBase derived class

Request - make IFieldData values accessible to BusinessBase derived class

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


rsbaker0 posted on Tuesday, December 09, 2008

Most of the implementation of FieldDataManager is marked as internal. Could you please (please, please, please... ;)  make a reasonable subset of this public so derived classes could access the current IFieldData associated with a managed property?

Maybe you changed this in CSLA 3.6, but in particular I would like to see at least FieldDataManager.GetFieldData(IPropertyInfo. prop) be public rather than internal.

You evidently allow derived PropertyInfo classes, which can even construct their own custom IFieldData class when CSLA is loading the property data, but I don't see how I could can access the custom IFieldData object directly once I created it.

I could discard some entire classes if I could just store an additional value in a custom IFieldData object that I could get to using the corresponding PropertyInfo object.

Andreas replied on Wednesday, December 10, 2008

Yes, yes. Great request. See my post:

http://forums.lhotka.net/forums/thread/28129.aspx

To implement an original/new value management you have to call FieldDataManager.GetFieldData() somewhere. Currently the only way to access it is through an ugly and slow reflection call:

this.FieldManager.GetType().GetMethod("GetFieldData", System.Reflection.BindingFlags.FlattenHierarchy |
                System.Reflection.BindingFlags.NonPublic |
                System.Reflection.BindingFlags.Instance,
                null, new Type[] { typeof(IPropertyInfo) }, null ).Invoke(this,  new object[] { info} );

 

Copyright (c) Marimer LLC