• About
  • Privacy Policy
  • Utilities
Darchuk.NET

Author: Robert

Bytes and Nibbles and Hex

July 26, 2019 by Robert Leave a Comment

I’ve never really liked hexadecimal notation.  The combination of letters and numbers always made my brain turn off.  I mean, I understand it, but it never seemed like it made a difference or not. via GIPHY Binary Obviously, computers think in ones and zeroes.  The smallest unit is typically talked about as a byte, which … [Read more…]

Posted in: C#, Web Development Tagged: Bit Shifting, Bitwise, byte, C#, Networking, nibble

SignalR Strongly-Typed Hubs

July 19, 2019 by Robert 3 Comments

Previously I talked about how to set up the server side of SignalR for facilitating real-time communication.  One of the parts that I don’t particularly care for in that default implementation is that the hub methods (the messages that are sent to connected clients) are identified by strings.  Sure, you could create some string constants … [Read more…]

Posted in: .NET Core, ASP.NET, Asynchronous, C#, SignalR, Web Development Tagged: C#, Magic Strings, Realtime, SignalR

ASP.NET Core 2.2 SignalR Server

July 12, 2019 by Robert 1 Comment

SignalR is a technology that allows you to write bi-directional communication between a server and a client.  This can lead to some pretty cool interactions, such as a live-updating dashboard on a website, or the ability to communicate requests to a server without building HTTP endpoints.  SignalR does a lot of heavy lifting behind the … [Read more…]

Posted in: .NET Core, ASP.NET, C#, SignalR, Web Development Tagged: .NET Core, ASP.NET, C#, Realtime, SignalR, Web Development

Creating a .zip file with .NET

July 5, 2019 by Robert Leave a Comment

For some reason I always thought that you needed to add a third party library to make a zip file in C#, but apparently you can do it easily with an API that already exists in the framework. via GIPHY ZipArchive All you need to do is create a file and associate the file stream … [Read more…]

Posted in: .NET Core, C# Tagged: .NET, C#, DotNet, Zip

ASP.NET Core Unit Testing – Setting the request body

June 28, 2019 by Robert Leave a Comment

Every now and again I find it necessary to set up the request body manually (as opposed to using the [FromBody] tag).  In the controller you can read from the request body easily enough: via GIPHY Testing How do you test this?  Normally I would just create a controller, call the method, and check the … [Read more…]

Posted in: .NET Core, ASP.NET, C#, MVC, Unit Testing, Web API, Web Development Tagged: ASP.NET, ASP.NET Core, Csharp, unit testing, Web Development

TypeScript – Enumerating object properties with Object.keys

June 21, 2019 by Robert Leave a Comment

One of the benefits of JavaScript (and therefore TypeScript) is being able to do whatever you want with objects.  This can be dangerous, of course, because of type promiscuity – which is one thing that TypeScript addresses. via GIPHY Object.keys Sometimes it is still useful to just loop through each property on an object in … [Read more…]

Posted in: JavaScript, Reflection, Typescript, Web Development Tagged: Gotcha, JavaScript, Reflection, Typescript

Angular date picker with NgbDatePicker

June 14, 2019 by Robert Leave a Comment

DatePickers are pretty much a dime a dozen these days, but if you are already using a framework that already has a DatePicker, it makes sense to use that. via GIPHY ng-bootstrap ng-bootstrap is a package of Angular components that are built using Bootstrap 4.  So, if you’re already using Bootstrap and Angular, it could … [Read more…]

Posted in: Angular, CSS, HTML, JavaScript, Typescript Tagged: Angular, Bootstrap, HTML, JavaScript, Typescript

Callback MemoryStream

June 7, 2019 by Robert Leave a Comment

In the last post I talked about streaming data back via a WebAPI.  On the front end, I had a “download” button that I wanted to disable until the download is complete, so that users don’t inadvertently spam the server with download requests.  When the button is clicked, an iframe is opened to the WebAPI … [Read more…]

Posted in: ASP.NET, C#, SignalR, Web API Tagged: C#, Callback, SignalR, Streams

ASP.NET Core Web API–Returning a FileStream

May 31, 2019 by Robert 3 Comments

So I built a service that collects information, say, log information, and sends it down to a client.  This information is normally streamed right to a web browser via SignalR, but sometimes there is a lot of it, and scrolling through it on the web view can be quite a pain.  It would be nice … [Read more…]

Posted in: .NET Core, ASP.NET, C#, Web API, Web Development Tagged: ASP.NET, C#, File Download, Stream, WebAPI

Spoofing a C# Stopwatch

May 24, 2019 by Robert Leave a Comment

C# has a Stopwatch class that is pretty accurate at timing things.  In fact, it uses some low-level operating system stuff to make sure to get exact timings.  This means it can be more accurate than comparing two different DateTime.Now instances. via GIPHY I’ve found myself using the Stopwatch occasionally, but it always is kind … [Read more…]

Posted in: .NET Core, C#, Unit Testing Tagged: .NET, C#, Testing, unit testing
« Previous 1 2 3 … 12 Next »

Recent Posts

  • Allowing trailing JSON commas in ASP.NET Core 3
  • YADNC3JSG–Yet Another .NET Core 3.0 JSON Serializer Gotcha
  • Logging in a .NET Core 3 SignalR client
  • .NET Core 3 unit testing project sdk
  • .NET Core 3.0 Upgrade–New JSON Serializer Gotchas

Recent Comments

  1. Robert on C# Setting Socket Keep-Alive
  2. Oliver Schramm on C# Setting Socket Keep-Alive
  3. John Anderson on Waiting for a keypress asynchronously in a C# console app
  4. Ronald Garlit on .NET Core 3 unit testing project sdk
  5. Ronald Garlit on .NET Core 3 unit testing project sdk

Copyright © 2025 Darchuk.NET.

Omega WordPress Theme by ThemeHall