public async Task <ActionResult> GetUserProfile()
        {
            var _token = InitializeToken();

            try
            {
                var result = await _profileLogic.GetUserProfile(_token.UserId);

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(_helper.CreateApiError(ex));
            }
        }
        public async Task <ActionResult> GetAccessToken(Login Login)
        {
            try
            {
                var result = await _profileLogic.GetLogedInUserProfile(Login.UserName, Login.Password);

                if (result == null)
                {
                    return(Unauthorized(_helper.BuildResponse("Error", null, "Invalid Credentials", (int)HttpStatusCode.Unauthorized)));
                }

                var loggedInUserDetail = new UserDetail()
                {
                    UserId    = result.UserId,
                    UserName  = result.UserName,
                    Password  = result.Password,
                    FirstName = result.FirstName,
                    LastName  = result.LastName,
                    Role      = result.Role
                };
                var accessToken = await _authService.GetAccessToken(loggedInUserDetail);

                await _profileLogic.AddLogin(result.UserId, accessToken.Token, accessToken.Refreshtoken);

                if (accessToken == null)
                {
                    return(Unauthorized(_helper.BuildResponse("Error", null, "Invalid Credentials", (int)HttpStatusCode.Unauthorized)));
                }

                return(Ok(accessToken));
            }
            catch (Exception ex)
            {
                return(_helper.CreateApiError(ex));
            }
        }