Navigation
GitHubSpark Navigation
Data last updated: 2025-05-09 13:56:39 UTC Fresh data
GitHub User
Avatar
markhazleton

Joined GitHub on March 2010

Solutions Architect, lifelong learner, passionate for solutions which make technology work for business, not sidetracked by sizzle

Wichita, KS

View Profile
Repositories Information

Decorator Design Pattern: Adding Telemetry to HttpClient
Main Language: HTML
Owner markhazleton
Size 2665 KB
Default Branch main
Visibility public
License MIT License
Created At 2023-02-09
Last Push 2025-05-08 21:21
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Main Language: Not specified
Owner markhazleton
Size 6484 KB
Default Branch main
Visibility public
License None
Created At 2021-04-17
Last Push 2025-05-05 01:54
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

HttpClientUtility for management .Net HttpClient
Main Language: C#
Owner markhazleton
Size 158 KB
Default Branch main
Visibility public
License MIT License
Created At 2025-05-03
Last Push 2025-05-05 00:19
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Main Language: C#
Owner markhazleton
Size 2815 KB
Default Branch main
Visibility public
License Other
Created At 2023-03-24
Last Push 2025-05-04 15:20
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Main Language: Pug
Owner markhazleton
Size 74739 KB
Default Branch main
Visibility public
License MIT License
Created At 2023-07-28
Last Push 2025-05-04 04:37
Repository Statistics
Stars: 1 Watchers: 1 Forks: 0 Open Issues: 0

C# Barcode Image Generation Library
Main Language: JavaScript
Owner markhazleton
Size 53603 KB
Default Branch main
Visibility public
License Apache License 2.0
Created At 2019-06-20
Last Push 2025-05-04 03:27
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

This is my first React Portfolio site used to learn react and vite
Main Language: CSS
Owner markhazleton
Size 42039 KB
Default Branch main
Visibility public
License MIT License
Created At 2024-10-11
Last Push 2025-05-04 03:18
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Google Maps Web Services API wrapper for .NET
Main Language: C#
Owner markhazleton
Size 2230 KB
Default Branch main
Visibility public
License BSD 2-Clause "Simplified" License
Created At 2024-03-28
Last Push 2025-05-04 02:20
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

A very simple key press counter and logger for windows
Main Language: C#
Owner markhazleton
Size 65 KB
Default Branch main
Visibility public
License MIT License
Created At 2024-03-07
Last Push 2025-05-03 01:37
Repository Statistics
Stars: 1 Watchers: 1 Forks: 1 Open Issues: 0

Demonstration of some Async Methods
Main Language: C#
Owner markhazleton
Size 1400 KB
Default Branch main
Visibility public
License MIT License
Created At 2022-08-07
Last Push 2025-04-27 16:24
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

PromptSpark Chat Workflow: Real-time Conversational Flows with ASP.NET Core and Adaptive Cards
Main Language: C#
Owner markhazleton
Size 18717 KB
Default Branch main
Visibility public
License MIT License
Created At 2024-12-31
Last Push 2025-04-27 04:54
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

An application to demonstrate multiple ways of implementing simple maintenance (CRUD) and user interface in ASP.Net using latest public versions.
Main Language: JavaScript
Owner markhazleton
Size 29472 KB
Default Branch main
Visibility public
License MIT License
Created At 2019-04-25
Last Push 2025-04-22 12:27
Repository Statistics
Stars: 8 Watchers: 8 Forks: 3 Open Issues: 0

This is the personal GitHub profile for Mark Hazleton
Main Language: SCSS
Owner markhazleton
Size 132 KB
Default Branch sources
Visibility public
License MIT License
Created At 2021-04-18
Last Push 2025-04-22 05:02
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

A JavaScript Development Environment (a.k.a. Starter Kit)
Main Language: CSS
Owner markhazleton
Size 2665 KB
Default Branch main
Visibility public
License None
Created At 2022-06-06
Last Push 2025-04-12 23:14
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

The official .NET library for the OpenAI API
Main Language: Not specified
Owner markhazleton
Size 16923 KB
Default Branch main
Visibility public
License MIT License
Created At 2025-03-16
Last Push 2025-03-12 16:28
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Extensions for the Azure.Data.Tables library to easier access & manipulate data inside Azure Table Storage
Main Language: Not specified
Owner markhazleton
Size 249 KB
Default Branch main
Visibility public
License MIT License
Created At 2025-02-25
Last Push 2024-03-13 22:17
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

An simple and easy Url Shortener
Main Language: Not specified
Owner markhazleton
Size 22517 KB
Default Branch main
Visibility public
License MIT License
Created At 2025-01-22
Last Push 2025-01-20 21:02
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Main Language: C#
Owner markhazleton
Size 1314 KB
Default Branch master
Visibility public
License MIT License
Created At 2020-07-02
Last Push 2024-12-24 13:47
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

:sound: A Client for the Spotify Web API, written in C#/.NET
Main Language: C#
Owner markhazleton
Size 6193 KB
Default Branch master
Visibility public
License MIT License
Created At 2022-10-25
Last Push 2024-12-03 13:04
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 2

Some useful base classes, mainly used with the CleanArchitecture template. Also, a template to make your own SharedKernel nuget package.
Main Language: C#
Owner markhazleton
Size 52 KB
Default Branch main
Visibility public
License MIT License
Created At 2024-07-25
Last Push 2024-10-29 13:18
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Pluralsight Project for Blazor Bug Tracking
Main Language: C#
Owner markhazleton
Size 1556 KB
Default Branch master
Visibility public
License None
Created At 2022-06-08
Last Push 2024-10-29 12:43
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

A Demo of what you can do with a CSV file
Main Language: Visual Basic .NET
Owner markhazleton
Size 12170 KB
Default Branch main
Visibility public
License MIT License
Created At 2023-04-20
Last Push 2024-09-24 15:55
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Demo Of Hitting Art Institute Public API
Main Language: C#
Owner markhazleton
Size 16 KB
Default Branch main
Visibility public
License MIT License
Created At 2023-01-30
Last Push 2024-09-21 03:52
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Learning Concurrent Processing Through Code
Main Language: C#
Owner markhazleton
Size 33 KB
Default Branch main
Visibility public
License MIT License
Created At 2023-09-18
Last Push 2024-09-21 03:28
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

A console application for Sqlite database that runs a set of SQL scripts and save the output to CSV files
Main Language: C#
Owner markhazleton
Size 85 KB
Default Branch main
Visibility public
License None
Created At 2017-11-06
Last Push 2024-09-21 03:27
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Samples associated with Pluralsight design patterns in c# courses.
Main Language: C#
Owner markhazleton
Size 203 KB
Default Branch main
Visibility public
License MIT License
Created At 2021-02-03
Last Push 2024-09-21 03:20
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 9

Demo of FastEndpoints Nuget Packages
Main Language: C#
Owner markhazleton
Size 45 KB
Default Branch main
Visibility public
License MIT License
Created At 2024-04-06
Last Push 2024-09-21 03:17
Repository Statistics
Stars: 1 Watchers: 1 Forks: 1 Open Issues: 0

Main Language: JavaScript
Owner markhazleton
Size 19430 KB
Default Branch master
Visibility public
License None
Created At 2020-03-29
Last Push 2024-08-05 12:23
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

A small console application to run REST requests
Main Language: C#
Owner markhazleton
Size 162 KB
Default Branch main
Visibility public
License MIT License
Created At 2021-09-30
Last Push 2024-09-21 01:46
Repository Statistics
Stars: 2 Watchers: 2 Forks: 0 Open Issues: 0

Sandbox for trying out new stuff
Main Language: C#
Owner markhazleton
Size 170 KB
Default Branch main
Visibility public
License None
Created At 2022-06-10
Last Push 2024-02-07 13:56
Repository Statistics
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

Understanding GitHub and Its API

GitHub Platform

GitHub is the world's leading platform for software development and version control, enabling millions of developers to collaborate on projects. Its ecosystem includes:

  • Version control using Git
  • Team collaboration tools
  • Code management
  • CI/CD automation
GitHub API

The GitHub API provides programmatic access to GitHub data and functionality, enabling developers to:

  • Retrieve user profiles
  • List repositories and their contents
  • Track issues and pull requests
  • Automate workflows and tasks

By leveraging the GitHub API with asynchronous programming in .NET, you can create responsive applications that seamlessly integrate GitHub data while maintaining optimal performance and user experience.

Integrating GitHub User and Repo Data into WebSpark's GitHubSpark Section

In this tutorial, we'll walk through how to use GitHub's API and asynchronous programming in .NET to create a responsive and interactive interface for displaying GitHub user and repository data in the GitHubSpark section of WebSpark. We will also make use of Bootstrap 5 to design a polished and user-friendly interface.

Why Use Async Programming?

Asynchronous programming is crucial when working with external APIs, like GitHub's, because it ensures the web page remains responsive while waiting for the API responses. The async/await pattern in .NET helps make non-blocking API calls and ensures that the user experience is not interrupted, enhancing the smoothness and efficiency of your web application.

Fetching GitHub Data Asynchronously

First, we will create a method that fetches GitHub user and repository data asynchronously using the HttpClient class. This allows us to make non-blocking HTTP requests to the GitHub API.


public async Task<GitHubCacheViewModel> GetGitHubDataAsync(string username, string repoName)
{
    var user = await _httpClient.GetFromJsonAsync<GitHubUser>($"https://api.github.com/users/{username}");
    var repo = await _httpClient.GetFromJsonAsync<GitHubRepo>($"https://api.github.com/repos/{username}/{repoName}");

    return new GitHubCacheViewModel
    {
        User = user,
        RepoInfo = repo
    };
}

In the code above, we use the await keyword to make sure the API requests to GitHub are handled asynchronously, improving the efficiency of our application by not blocking the main thread.

Creating the View Model

Next, we define a view model, GitHubCacheViewModel, to store the user and repository data. This helps to separate the data fetching logic from the view.


public class GitHubCacheViewModel
{
    public GitHubRepo? RepoInfo { get; set; }
    public GitHubUser? User { get; set; }
}

With this model, we can easily pass data from our controller to the view and render it in the UI.

Building the Bootstrap-Powered View

We can now create a Bootstrap-powered view to display the GitHub user and repository data. Bootstrap 5's responsive components make it easy to create an attractive and functional UI that works across different screen sizes. Below is an example of how to display the GitHub user's information in a card component.


<div class="card shadow-sm">
    <div class="card-header bg-dark text-white">
        <h5 class="card-title mb-0">
            <i class="bi bi-person-circle"></i> GitHub User
        </h5>
    </div>
    <div class="card-body text-center">
        <img src="@Model.User?.ResponseResults?.AvatarUrl" alt="Avatar" class="rounded-circle img-thumbnail mb-3">
        <h5 class="card-title">@Model.User?.ResponseResults?.Login</h5>
        <p class="text-muted">@Model.User?.ResponseResults?.Bio</p>
        <a href="@Model.User?.ResponseResults?.HtmlUrl" class="btn btn-primary" target="_blank">
            <i class="bi bi-github"></i> View Profile
        </a>
    </div>
</div>

In this example, we used Bootstrap's card component along with Bootstrap Icons to create a user-friendly and aesthetically pleasing UI for displaying GitHub user data.

Handling Asynchronous Fetching with Grace

When working with asynchronous data fetching, it's essential to provide feedback to the user. If the GitHub API request fails or data is unavailable, displaying an error message can enhance the user experience.


@if (Model.User == null)
{
    <div class="alert alert-danger" role="alert">
        Could not retrieve GitHub user data. Please try again later.
    </div>
}

This ensures that the UI remains engaging, even if the external API call fails.

Conclusion

Integrating GitHub user and repository data into the GitHubSpark section of WebSpark demonstrates the power of asynchronous programming in .NET. Not only does it show how easily external APIs can be consumed, but it also highlights how to build a responsive, user-friendly interface using Bootstrap 5.

Asynchronous programming ensures that the page loads smoothly, even when waiting for external resources like GitHub's API. Combining clean async code with polished Bootstrap design, WebSpark illustrates how developers can benefit from both performance and aesthetics in real-world applications.