Given the following:
public class Customer : EntityBase{
public virtual string Name {get;set;}
//Snip
public void TestError(){
throw new Exception("Test");
}
}
When I load this entity using NH and call the "TestError" method. Instead
of getting that Exception I am getting it inside another one nested in the
InnerExecptionProperty.
The actual exception is:
System.Reflection.TargetInvocationException
"{"Exception has been thrown by the target of an invocation."}"
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[]
arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at NHibernate.Proxy.DynamicProxy.InvocationInfo.InvokeMethodOnTarget()
at
NHibernate.Intercept.DefaultDynamicLazyFieldInterceptor.Intercept(InvocationInfo
info)
at CustomerProxy.TestError()
Why is this happening? I don't understand why my exception is being wrapped
inside another one from the DynamicProxy.
Thanks, Mark
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.