diff --git a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/ApiBaseViewModel.cs b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/ApiBaseViewModel.cs index 9cc3dfd..9c74d29 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/ApiBaseViewModel.cs +++ b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/ApiBaseViewModel.cs @@ -21,7 +21,7 @@ public class ApiBaseViewModel : BaseViewModel /// /// /// - public async virtual Task ExecuteApi(Func> getServerResult, Func, Task> onSuccess, Func onError = default) + public async virtual Task ExecuteApi(Func> getServerResult, Func, Task> onSuccess, Func onError = default) { try { @@ -55,7 +55,7 @@ public async virtual Task ExecuteApi(Func> getServerResult /// /// /// - public virtual async Task ExecuteApi(Func> getServerResult, Func onSuccess = default, Func onError = default) + public virtual async Task ExecuteApi(Func> getServerResult, Func onSuccess = default, Func onError = default) { try { @@ -85,6 +85,6 @@ public virtual async Task ExecuteApi(Func> getServerResult, Func /// /// - public virtual Task DisplayServerError(ErrorContract errorContract) + public virtual Task OnServerError(ErrorContract errorContract) { return Task.CompletedTask; } diff --git a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Commands/BaseCommand.cs b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Commands/BaseCommand.cs index 15800ca..bf30aeb 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Commands/BaseCommand.cs +++ b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Commands/BaseCommand.cs @@ -86,7 +86,7 @@ public virtual void Execute(object parameter) } catch (InvalidResultOfMessageContractException ex) { - _busyViewModel?.DisplayServerError(ex.MessageContract.Error); + _busyViewModel?.OnServerError(ex.MessageContract.Error); } catch (Exception ex) { diff --git a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Commands/TaskBaseCommand.cs b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Commands/TaskBaseCommand.cs index 2a05006..a7c6fa8 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Commands/TaskBaseCommand.cs +++ b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Commands/TaskBaseCommand.cs @@ -87,7 +87,7 @@ async Task InternalExecute(object parameter) } catch (InvalidResultOfMessageContractException ex) { - _busyViewModel?.DisplayServerError(ex.MessageContract.Error); + _busyViewModel?.OnServerError(ex.MessageContract.Error); } catch (Exception ex) { diff --git a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/EasyMicroservices.UI.Cores.Mvvm.csproj b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/EasyMicroservices.UI.Cores.Mvvm.csproj index 376fc5b..1bdaa15 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/EasyMicroservices.UI.Cores.Mvvm.csproj +++ b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/EasyMicroservices.UI.Cores.Mvvm.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.16 + 0.0.0.17 Model View View Model EasyMicroservices@gmail.com mvvm,mvpvm,modelview,modelviewviewmodel diff --git a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Interfaces/IBusyViewModel.cs b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Interfaces/IBusyViewModel.cs index 7022894..0179145 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Interfaces/IBusyViewModel.cs +++ b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/Interfaces/IBusyViewModel.cs @@ -40,7 +40,7 @@ public interface IBusyViewModel : INotifyPropertyChanged /// /// /// - Task DisplayServerError(ErrorContract errorContract); + Task OnServerError(ErrorContract errorContract); /// /// diff --git a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/PageBaseViewModel.cs b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/PageBaseViewModel.cs index 7e14568..de7885c 100644 --- a/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/PageBaseViewModel.cs +++ b/src/CSharp/Cores/EasyMicroservices.UI.Cores.Mvvm/PageBaseViewModel.cs @@ -136,7 +136,7 @@ public override Task OnError(Exception exception) /// /// /// - public override Task DisplayServerError(ErrorContract errorContract) + public override Task OnServerError(ErrorContract errorContract) { return Page.DisplayAlert("Server Error", $"{errorContract?.FailedReasonType}{Environment.NewLine}{errorContract?.Message}{Environment.NewLine}{errorContract?.Details}{Environment.NewLine}{errorContract?.StackTrace}", "Ok"); }