// POST: api/Authenticate
        public LoginUserDetails Authenticate([FromBody] LoginUserRequest logindetils)
        {
            Token            newtoken  = new Token();
            LoginUserDetails Detils    = new LoginUserDetails();
            string           admission = logindetils.coursetype + "/" + logindetils.batchname + "/" + logindetils.Rollno;

            if (string.IsNullOrEmpty(admission) && string.IsNullOrEmpty(logindetils.Password))
            {
                //var message = new HttpResponseMessage(HttpStatusCode.NotAcceptable);
                //message.Content = new StringContent("Not Valid Request");
                //return message;
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }
            else
            {
                Detils.LoginUser = LoginUserDetails(admission, logindetils.Password);
                Applicationsdlp ClientKeys = new Applicationsdlp();
                ClientKeys.AdmissionNo = admission;
                ClientKeys.Password    = logindetils.Password;
                if (_IAuthenticate.ValidateKeys1(ClientKeys))
                {
                    var clientkeys = _IAuthenticate.GetApplicationsdlpDetils(ClientKeys.AdmissionNo, ClientKeys.Password);
                    if (clientkeys == null)
                    {
                        //var message = new HttpResponseMessage(HttpStatusCode.NotFound);
                        //message.Content = new StringContent("InValid Keys");
                        //return message;
                        throw new HttpResponseException(HttpStatusCode.BadRequest);
                    }
                    else
                    {
                        if (_IAuthenticate.IsTokenAlreadyExists1(clientkeys.Code))
                        {
                            _IAuthenticate.DeleteGenerateToken1(clientkeys.Code);
                            newtoken            = GenerateandSaveToken1(clientkeys);
                            Detils.TokenDetails = newtoken;
                        }
                        else
                        {
                            newtoken            = GenerateandSaveToken1(clientkeys);
                            Detils.TokenDetails = newtoken;
                        }
                    }
                }
                else
                {
                    return(Detils);
                }
            }
            return(Detils);
        }