//vsoalnki 13-11-2018
        public TemplateMasterRes GetTemplateMasterById(long TemplateMasterId)
        {
            TemplateMasterRes res = new TemplateMasterRes();

            try
            {
                var template = _masterConfigurationRepository.GetTemplateMasterById(TemplateMasterId);
                // var template = _TemplateMaster.GetById(TemplateMasterId);
                if (template != null)
                {
                    res.ReturnCode        = enResponseCode.Success;
                    res.ErrorCode         = enErrorCode.Success;
                    res.ReturnMsg         = EnResponseMessage.FindRecored;
                    res.TemplateMasterObj = template;
                    return(res);
                }
                res.ReturnCode = enResponseCode.Fail;
                res.ErrorCode  = enErrorCode.RecordNotFound;
                res.ReturnMsg  = EnResponseMessage.NotFound;
                return(res);
            }
            catch (Exception ex)
            {
                HelperForLog.WriteErrorLog(System.Reflection.MethodBase.GetCurrentMethod().Name, this.GetType().Name, ex);
                throw ex;
            }
        }
        public async Task <IActionResult> GetTemplateById(long TemplateMasterId)
        {
            TemplateMasterRes Response = new TemplateMasterRes();

            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.GetTemplateMasterById(TemplateMasterId);
                }
                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
                }));
            }
        }