public IActionResult Get([FromQuery] long?userId) { if (userId != null) { return(Ok(_goalRepository.AllByUser(userId.Value))); } return(Ok(_goalRepository.All)); }