I would like to suggest the following change to the thrown error in "Csla.Reflection.MethodCaller.CallMethod":
public static object CallMethod(object obj, string method, params
object[] parameters)
public static object CallMethod(object obj,
MethodInfo info, params object[] parameters)
From: throw new NotImplementedException(method + " " + Resources.MethodNotImplemented
To: throw new NotImplementedException(method + " " + Resources.MethodNotImplemented + " on " + obj.GetType().ToString());
The benefit is that the error messages gives a better clue to what is missing.
Thanks
Something like this is a good idea. The word "on" is English though, so it can't be hard-coded into the output.
The real answer is for the MethodNotImplemented resource to be a string format mask - but that'd break all the international translations - and by break I mean throw an exception at runtime - so it is somewhat hard to do the right thing :(
Ouch, forgot that part.
You could use something else to delimit the object type such as brackets. That would be reasonably language independent and almost as readable.
To: throw new NotImplementedException(method + " " + Resources.MethodNotImplemented + " ( " + obj.GetType().ToString() + ")");
Anthony
Copyright (c) Marimer LLC