public async Task SetFoto(byte[] stream, string path) { try { await Task.Factory.FromAsync(proxy.BeginSetFoto(stream, path, null, null), proxy.EndSetFoto); } catch (Exception ex) { throw ex; } }