CSharp

Exploring .NET streaming API scenarios

Use the IAsyncEnumerable<T> interface to stream data from a server to a client.

David Pine

14 minute read

...

❗ IMPORTANT The featured image was generated using bing.com/create powered by DALL·E. Exploring .NET streaming API scenarios If you’re a .NET developer, chances are you’re already familiar with the IAsyncEnumerable<T> interface. This interface was introduced in .NET Core 3.0 and is used to asynchronously iterate over a collection of data. This is a great way to stream data from a server to a client. In this post, you’ll learn how to:

A conversation with ChatGPT

Focusing on .NET Dependency Injection

David Pine

7 minute read

❗ IMPORTANT This post was generated using ChatGPT. I prompted the AI with a few leading questions and formatted the responses as the body text of this post. For more information, see the ChatGPT. A conversation with ChatGPT about .NET Dependency Injection What is dependency injection and why is it important? David Pine Dependency injection is a software design pattern that allows a programmer to remove hard-coded dependencies and make them configurable.

Hello from the GitHub Actions: Core .NET SDK

The unofficial .NET equivalent of the official GitHub actions/toolkit @actions/core project.

David Pine

15 minute read

Example source code for the GitHub Actions Core .NET SDK.

📢 ATTENTION This post is part of the C# advent calendar 2022, for other articles in this collection see C# Advent Calendar 2022. This is the third time I’ve written for the calendar, past entries include 2017: C# Special Edition and 2018: C# All The Things. 🙏🏽 GitHub Actions: Core .NET SDK SDKs are great, but why do we need one for GitHub Actions? The short answer is, you don’t!

Learning Blazor

Build Single-Page Apps with WebAssembly and C#

David Pine

6 minute read

The Learning Blazor title book cover

In June 2021, I set out on a journey to write a book in the middle of a global pandemic. I had no idea what I was doing (all things considered, I still don’t know what I’m doing). But I do know that I truly enjoy helping others. I hope you enjoy the book as much as I enjoyed writing it. Amazon Preview Foreword by Steve Sanderson Web development has been a dominating feature of the software industry for over 20 years and is likely to remain so for many years to come.

Blazorators

C# Source Generator for JavaScript Interop in Blazor

David Pine

5 minute read

The Blazorators logo

Blazorators Blazorators is a C# source generator that creates fully functioning Blazor JavaScript interop code, targeting either the IJSInProcessRuntime or IJSRuntime types. All of this code relies on the output of one of my side projects named blazorators. While writing my O’Reilly “Learning Blazor: Build Single-Page Apps with WebAssembly and C#” book, I discovered an impactful way to use both TypeScript type declarations from common JavaScript APIs and C# source generators to generate the JavaScript interop code.

David Pine

13 minute read

Intro With more than 40 million active users, GitHub is by far the largest source code hosting platform in the world. It’s an open source developers dream, and ecosystem and developer community unlike any other. And with all these users and such profound openness, there’s bound to be frustration from time to time. In this post we will explore an Azure Function written with ASP.NET Core 3.0 and C# 8.0. It has been designed to handle a GitHub webhook for issues and pull requests.

ASP.NET Core - Slack Slash Commands

C# Slack API Integrations

David Pine

7 minute read

Background Most of us are all “slackers”, meaning we truly do spend a significant amount of time using Slack. Slack is a collaboration hub for work, no matter what work you do. It’s a place where conversations happen, decisions are made, and information is always at your fingertips. www.slack.com It’s wildly popular in the Developer Community! In fact, almost to a fault…people are constantly sharing their “slack fatigue”. I am personally a part of roughly twenty slack workspaces.

C# All The Things

.NET Core Global Tools. You don't need glasses to C#.

David Pine

8 minute read

I’m proud to share that this post is part of the C# Advent Calendar and it’s my second year contributing to it! I encourage you to check out all the others here . Developers Are Lazy In the world of web development it is hard to escape certain tools that we are forced to rely on. As developers we’re innately lazy and it is safe to say that perhaps we don’t really care enough to look into other tooling options.

Writing a Blazor App

A Practical WebAssembly Application In C#

David Pine

7 minute read

Every time a developer encounters a new technology it’s in our nature to explore it. This is the case with WebAssembly, and Microsoft’s vision of the world in Blazor. Blazor is single page application framework that sits atop of WebAssembly, but it’s still considered an experiment. I had the chance to interview Steve Sanderson about WebAssembly and Blazor – I shared . Now, I’d like to explore Blazor with you a bit more.

David Pine

11 minute read

Inspiration I recently returned from Charleston, South Carolina – where I spoke at SyntaxCon. The event was very professionally organized and gave me inspiration for Cream City Code. In the main hall, they had a HALO by Simple Booth . It serves as a photo booth with a conference-specific backdrop – which is perfect for sharing the conference experience. I looked into purchasing one but was encouraged to simply write my own… so I did and this blog will detail that process.