public async Task <IActionResult> GetAllTemplate() { ListTemplateMasterRes Response = new ListTemplateMasterRes(); try { ApplicationUser user = new ApplicationUser(); user.Id = 1; //ApplicationUser user = await _userManager.GetUserAsync(HttpContext.User); if (user == null) { Response.ReturnCode = enResponseCode.Fail; Response.ReturnMsg = EnResponseMessage.StandardLoginfailed; Response.ErrorCode = enErrorCode.StandardLoginfailed; } else { var accessToken = await HttpContext.GetTokenAsync("access_token"); Response = _communicationService.GetAllTemplateMaster(); } var respObj = JsonConvert.SerializeObject(Response); dynamic respObjJson = JObject.Parse(respObj); return(Ok(respObjJson)); } catch (Exception ex) { return(BadRequest(new BizResponseClass { ReturnCode = enResponseCode.InternalError, ReturnMsg = ex.ToString(), ErrorCode = enErrorCode.Status500InternalServerError })); } }