Hello!
My englishis bad. Sorry. I like CSLA and your book. I buy it and read. Your framework help me save our time.
CSLA 4.0.1 beta. I found 2 Mistakes in class WcfPortal:
1. Method proxy_DeleteCompleted and others (UpdateCompleted, ExecuteCompleted ...) fails on e.Result when we have CommunicationException.
private void proxy_DeleteCompleted(object sender, Csla.WcfPortal.DeleteCompletedEventArgs e)
{
var response = ConvertResponse(e.Result);
try
{
if (e.Error == null && response.ErrorData == null)
{
_globalContext = (ContextDictionary)MobileFormatter.Deserialize(response.GlobalContext);
OnDeleteCompleted(new DataPortalResult<T>(default(T), null, e.UserState));
}
else if (response.ErrorData != null)
{
var ex = new DataPortalException(response.ErrorData);
OnDeleteCompleted(new DataPortalResult<T>(default(T), ex, e.UserState));
}
else
{
OnDeleteCompleted(new DataPortalResult<T>(default(T), e.Error, e.UserState));
}
}
catch (Exception ex)
{
OnUpdateCompleted(new DataPortalResult<T>(default(T), ex, e.UserState));
}
}
Because:
public Csla.WcfPortal.WcfResponse Result {
get {
base.RaiseExceptionIfNecessary();
return ((Csla.WcfPortal.WcfResponse)(this.results[0]));
}
}
And i dont have DeleteCompleted event :( My ProgressWindow still open and i dont know when close him :(
Because DeleteCompleted does not raises.
2.
OnUpdateCompleted(new DataPortalResult<T>(default(T), ex, e.UserState));
Why OnUpdateCompleted when this is in proxy_DeleteCompleted() method?
1. You are saying that this line:
var response = ConvertResponse(e.Result);
should be inside the try block? That is probably correct.
2. This looks like a bug.
Why try catch? I think just check e.Error for null.
Maybe like this:
Csla.WcfPortal.WcfResponse response = null;
if (e.Error == null)
response = ConvertResponse(e.Result);
if (e.Error == null && response != null && response.ErrorData == null)
I need something like this:
if (e.Error != null)
{
OnDeleteCompleted(new DataPortalResult<T>(default(T), e.Error, e.UserState));
return;
}
In last your checkin if e.Error != null i have never gain DeleteCompleted event :( I need know if CommunicationException or something else is occured.
Sorry. I view code. All right. That it was i need. thanks
Copyright (c) Marimer LLC