• Skip to primary navigation
  • Skip to main content

Josh Withee

  • Home
  • Blog
  • Contact
  • Show Search
Hide Search

ASP.NET Core

Singleton Pattern Implementations

Josh Withee · September 10, 2020 · Leave a Comment

A brief reference on ways to implement the singleton pattern. Static Class Use a static class for your singleton only in the most basic of applications. Here is an example of using a static class for a threadsafe collection of objects that you want to access from anywhere in your …

[Read more...] about Singleton Pattern Implementations

SignalR Quickstart

Josh Withee · August 8, 2020 · 2 Comments

How to set up SignalR in your ASP.NET Core 3.1 project. Install the Microsoft.AspNetCore.SignalR NuGet package: Create a Hubs folder in your project, and create MySignalRHub.cs inside of it: Update MySignalRHub.cs like so: Use dependency injection to access your DbContext (or …

[Read more...] about SignalR Quickstart

ASP.NET Core 3.x Input Validation

Josh Withee · March 25, 2020 · Leave a Comment

See a mistake here? Or something missing? Let me know! Use C# Attributes from the System.ComponentModel.DataAnnotations namespace to add server-side and client-side validation. Tip: Keep your view model separate from your database model, because the same data attributes will do two different …

[Read more...] about ASP.NET Core 3.x Input Validation

Copyright © 2023