public string GetById(int?userId) { if (userId == null) { return("Please give me your id..."); } var helloString = _helloService.GetHelloStringByUserId((int)userId); return(helloString); }
public IActionResult GetById([FromRoute] HelloGetByUserIdRequest request) { var helloString = _helloService.GetHelloStringByUserId(request.UserId); var response = new HelloGetByUserIdResponse { Data = new HelloGetByUserIdResponseData { Message = helloString } }; return(new JsonResult(response)); }