public Task <List <UserDetails> > GetAllUsers()
        {
            List <UserDetails> lstDetails = new List <UserDetails>();

            using (sqlConnection = new SqlConnection(connection))
            {
                sqlCommand = new SqlCommand("select * from Credentials", sqlConnection);
                sqlConnection.Open();
                using (var objDataReader = sqlCommand.ExecuteReader())
                {
                    while (objDataReader.Read())
                    {
                        lstDetails.Add(UserDetails.Fill((IDataRecord)objDataReader));
                    }
                }
                return(Task.FromResult(lstDetails));
            }
        }
        public Task <UserDetails> Login(UserDetails userDetails)
        {
            bool rowAffected = false;

            using (sqlConnection = new SqlConnection(connection))
            {
                sqlCommand             = new SqlCommand("Login", sqlConnection);
                sqlCommand.CommandType = CommandType.StoredProcedure;
                sqlCommand.Parameters.Add("@UserDetails", SqlDbType.Structured).Value = CreateDataTable(userDetails);
                sqlConnection.Open();
                using (var objDataReader = sqlCommand.ExecuteReader())
                {
                    while (objDataReader.Read())
                    {
                        userDetails = UserDetails.Fill((IDataRecord)objDataReader);
                    }
                }
                return(Task.FromResult(userDetails));
            }
        }