public async Task <bool> UpdateRequest(JobRequest toUpdate) { //Modificar el job request enviado var result = _UsersRepo.UpdateRequest(toUpdate); if (result) { //Obtener el usuario al que se le envio el job request var userdata = _UsersRepo.Get(toUpdate.UserReciverId); //Agregar el nuevo usuario como empleado de la tienda si ya es usuario no se insertara var newEmployeeAdded = storesRepository.AddEmployeeToStore(userdata, toUpdate.StoreId); if (newEmployeeAdded) { //Obtener la connecion del usario var user = _UsersRepo.GetUserConnection(toUpdate.UserReciverId.ToString()); var sender = _UsersRepo.GetUserConnection(toUpdate.UserSenderId.ToString()); //Enviar notification al sender de que el request fue aceptado await NotificationHubContext.Clients.Client(sender.ConnectionID).SendAsync("RequestAccepted", JsonConvert.SerializeObject(toUpdate)); } } return(result); }