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

Following

ADefWebserver Avatar
ADefWebserver
ardalis Avatar
ardalis
barnhill Avatar
barnhill
benfoster Avatar
benfoster
binarythistle Avatar
binarythistle
codemillmatt Avatar
codemillmatt
dahlsailrunner Avatar
dahlsailrunner
dandraka Avatar
dandraka
davidaayers Avatar
davidaayers
dhei Avatar
dhei
Elfocrash Avatar
Elfocrash
FortuneN Avatar
FortuneN
GillCleeren Avatar
GillCleeren
hmol Avatar
hmol
HowardvanRooijen Avatar
HowardvanRooijen
jasontaylordev Avatar
jasontaylordev
johnpapa Avatar
johnpapa
KevinDockx Avatar
KevinDockx
KevinHock Avatar
KevinHock
madenwala Avatar
madenwala
madskristensen Avatar
madskristensen
MelGrubb Avatar
MelGrubb
meziantou Avatar
meziantou
MichalPaszkiewicz Avatar
MichalPaszkiewicz
nicolaskruchten Avatar
nicolaskruchten
nvie Avatar
nvie
plantuml Avatar
plantuml
plotly Avatar
plotly
RickStrahl Avatar
RickStrahl
shawnwildermuth Avatar
shawnwildermuth

Followers

Charles-Chrismann Avatar
Charles-Chrismann
davidaayers Avatar
davidaayers
gamemann Avatar
gamemann
IDouble Avatar
IDouble
KevinHock Avatar
KevinHock
MichalPaszkiewicz Avatar
MichalPaszkiewicz
mustafacagri Avatar
mustafacagri
Nakshatra05 Avatar
Nakshatra05
OfficialCodeVoyage Avatar
OfficialCodeVoyage
Salvelop07 Avatar
Salvelop07
warmice71 Avatar
warmice71
Repositories Information

Main Language:

Owner markhazleton
Size 6453 KB
Default Branch main
Visibility public
License None
Created At 2021-04-17
Last Push 2024-11-19 01:42
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

This is my first React Portfolio site used to learn react and vite

Main Language: CSS

Owner markhazleton
Size 38690 KB
Default Branch main
Visibility public
License MIT License
Created At 2024-10-11
Last Push 2024-11-14 20:31
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

Demonstration of some Async Methods

Main Language: C#

Owner markhazleton
Size 818 KB
Default Branch main
Visibility public
License MIT License
Created At 2022-08-07
Last Push 2024-11-13 15:59
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

Decorator Design Pattern: Adding Telemetry to HttpClient

Main Language: C#

Owner markhazleton
Size 1975 KB
Default Branch main
Visibility public
License MIT License
Created At 2023-02-09
Last Push 2024-11-13 15:55
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

An application to demonstrate multiple ways of implementing simple maintenance (CRUD) and user interface in ASP.Net using latest public versions.

Main Language: C#

Owner markhazleton
Size 28924 KB
Default Branch main
Visibility public
License MIT License
Created At 2019-04-25
Last Push 2024-11-13 15:27
Stars: 7 Watchers: 7 Forks: 2 Open Issues: 0

Additional Links

Some useful base classes, mainly used with the CleanArchitecture template. Also, a template to make your own SharedKernel nuget package.

Main Language: C# Fork

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
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

TaskListProcessor is a .NET utility for managing and monitoring asynchronous tasks, providing concurrent execution, result tracking, and detailed telemetry.

Main Language: C#

Owner markhazleton
Size 64 KB
Default Branch main
Visibility public
License MIT License
Created At 2023-11-09
Last Push 2024-10-29 12:47
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

Pluralsight Project for Blazor Bug Tracking

Main Language: C# Fork

Owner markhazleton
Size 1556 KB
Default Branch master
Visibility public
License None
Created At 2022-06-08
Last Push 2024-10-29 12:43
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

Additional Links

A JavaScript Development Environment (a.k.a. Starter Kit)

Main Language: EJS

Owner markhazleton
Size 2112 KB
Default Branch main
Visibility public
License None
Created At 2022-06-06
Last Push 2024-10-22 19:42
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

Additional Links

A multipurpose Bootstrap full website template created by Start Bootstrap

Main Language: Pug Fork

Owner markhazleton
Size 5611 KB
Default Branch master
Visibility public
License MIT License
Created At 2020-07-08
Last Push 2024-10-01 15:47
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

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
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

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
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

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
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

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
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

A very simple key press counter and logger for windows

Main Language: C#

Owner markhazleton
Size 44 KB
Default Branch main
Visibility public
License MIT License
Created At 2024-03-07
Last Push 2024-09-21 03:25
Stars: 1 Watchers: 1 Forks: 0 Open Issues: 0

Additional Links

Samples associated with Pluralsight design patterns in c# courses.

Main Language: C# Fork

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
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 9

Additional Links

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
Stars: 1 Watchers: 1 Forks: 0 Open Issues: 0

Additional Links

Main Language: C# Fork

Owner markhazleton
Size 1313 KB
Default Branch master
Visibility public
License MIT License
Created At 2020-07-02
Last Push 2024-09-21 02:30
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

C# Barcode Image Generation Library

Main Language: JavaScript Fork

Owner markhazleton
Size 53596 KB
Default Branch main
Visibility public
License Apache License 2.0
Created At 2019-06-20
Last Push 2024-09-21 01:33
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

Additional Links

Google Maps Web Services API wrapper for .NET

Main Language: C# Fork

Owner markhazleton
Size 2221 KB
Default Branch main
Visibility public
License BSD 2-Clause "Simplified" License
Created At 2024-03-28
Last Push 2024-09-06 02:03
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

Web Content Management system written in ASP.Net

Main Language: Visual Basic .NET

Owner markhazleton
Size 51381 KB
Default Branch main
Visibility public
License None
Created At 2017-09-19
Last Push 2024-08-22 14:15
Stars: 3 Watchers: 3 Forks: 0 Open Issues: 0

Additional Links

Simple RESTful API built with ASP.NET 6 and Net Standard 2.0 to show how to create RESTful services using a decoupled, maintainable architecture.

Main Language: C# Fork

Owner markhazleton
Size 259 KB
Default Branch main
Visibility public
License MIT License
Created At 2020-03-30
Last Push 2024-08-05 14:12
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

Main Language: JavaScript Fork

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

Additional Links

:sound: A Client for the Spotify Web API, written in C#/.NET

Main Language: C# Fork

Owner markhazleton
Size 6324 KB
Default Branch master
Visibility public
License MIT License
Created At 2022-10-25
Last Push 2024-08-05 11:55
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 2

Additional Links

A Library to allow theming of MVC Websites from Bootswatch

Main Language: C#

Owner markhazleton
Size 3869 KB
Default Branch main
Visibility public
License MIT License
Created At 2022-08-24
Last Push 2024-03-27 18:46
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 0

Additional Links

Main Language: C# Fork

Owner markhazleton
Size 457 KB
Default Branch main
Visibility public
License Other
Created At 2023-03-24
Last Push 2024-07-09 22:03
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

Additional Links

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
Stars: 2 Watchers: 2 Forks: 0 Open Issues: 0

Additional Links

This is the personal GitHub profile for Mark Hazleton

Main Language: Ruby

Owner markhazleton
Size 87 KB
Default Branch sources
Visibility public
License None
Created At 2021-04-18
Last Push 2023-05-10 14:39
Stars: 1 Watchers: 1 Forks: 0 Open Issues: 2

Additional Links

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
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

Additional Links

Course starting project for Pluralsight Course

Main Language: C# Fork

Owner markhazleton
Size 266 KB
Default Branch main
Visibility public
License MIT License
Created At 2019-08-08
Last Push 2024-07-09 21:53
Stars: 0 Watchers: 0 Forks: 0 Open Issues: 1

Additional Links

Understanding GitHub and Its API

GitHub is the world’s leading platform for software development and version control, enabling millions of developers to collaborate on open-source projects and private repositories. With a rich ecosystem of tools for version control, collaboration, and code management, GitHub has become essential for both individual developers and large teams.

At the core of GitHub's capabilities lies the GitHub API, a powerful interface that allows developers to programmatically interact with GitHub data. Whether you're looking to retrieve user profiles, list repositories, or track issues and pull requests, the GitHub API provides an accessible and efficient way to integrate GitHub’s vast data into your applications.

By using the GitHub API, developers can automate workflows, create custom dashboards, and extend the functionality of their projects with data straight from GitHub. In this guide, we’ll explore how to leverage this API to asynchronously fetch user and repository information, integrating it into a responsive and polished web interface using .NET and Bootstrap 5.

Explore GitHub API Documentation

Integrating GitHub User and Repo Data into WebSpark's AsyncSpark 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 AsyncSpark 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="https://avatars.githubusercontent.com/u/223906?v=4" alt="Avatar" class="rounded-circle img-thumbnail mb-3">
            <h5 class="card-title">markhazleton</h5>
            <p class="text-muted">Solutions Architect, lifelong learner, passionate for solutions which make technology work for business, not sidetracked by sizzle</p>
            <a href="https://github.com/markhazleton" 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. Here’s an example:


    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 AsyncSpark 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.