Ejemplo n.º 1
0
 public async override Task OnSaveAsync()
 {
     try
     {
         await _itemsService.AddOrUpdateAsync(EditItem);
     }
     catch (Exception ex)
     {
         _logger.LogError("error {0} in {1}", ex.Message, nameof(OnSaveAsync));
         await _messageService.ShowMessageAsync("Error saving the data");
     }
 }
    public override async Task OnSaveAsync()
    {
        try
        {
            if (EditItem is null)
            {
                throw new InvalidOperationException();
            }

            await _itemsService.AddOrUpdateAsync(EditItem);
        }
        catch (Exception ex)
        {
            _logger.LogError("error {0} in {1}", ex.Message, nameof(OnSaveAsync));
            await _dialogService.ShowMessageAsync("Error saving the data");
        }
    }
 public async override Task OnSaveAsync()
 {
     await _itemsService.AddOrUpdateAsync(EditItem);
 }