Hi Rocky
, i am using latest code in the repo. I noted if you create a command object with a business object property and if trying to LoadProperty in the Execute method i get a null reference exception from the csla assembly.
i noted the method in the ManagedObjectBase
protected virtual void LoadProperty(IPropertyInfo propertyInfo, object newValue)
{
var t = this.GetType();
var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
var method = t.GetMethods(flags).FirstOrDefault(c => c.Name == "LoadProperty" && c.IsGenericMethod);
var gm = method.MakeGenericMethod(propertyInfo.Type);
var p = new object[] { propertyInfo, newValue };
gm.Invoke(this, p);
}
if i change the method to this , the issue disappears
protected virtual void LoadProperty(IPropertyInfo propertyInfo, object newValue)
{
var t = this.GetType();
//var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
var method = t.GetRuntimeMethods().FirstOrDefault(c => c.Name == "LoadProperty" && c.IsGenericMethod);
var gm = method.MakeGenericMethod(propertyInfo.Type);
var p = new object[] { propertyInfo, newValue };
gm.Invoke(this, p);
}
In the attched repro the code are in the file FailOne.vb
Thank you.
Copyright (c) Marimer LLC