ASP.NET
YADNC3JSG–Yet Another .NET Core 3.0 JSON Serializer Gotcha
Previously I wrote about several “gotchas” in the new JSON serializer that is built in to .NET Core 3.0. Another one has cropped up, but it is different enough that I thought it warranted its own post. Type Promiscuity via GIPHY Back in 2010 or something like that, Ted Neward gave a talk about JavaScript … [Read more…]
Logging in a .NET Core 3 SignalR client
SignalR is part of the .NET Core framework that allows for real-time communication between a server and any number of clients. The traditional example is a JavaScript client that can receive updates directly from a web server asynchronously, but you can also connect to a SignalR hub with a C# client. via GIPHY HubConnectionBuilder To … [Read more…]
SignalR Strongly-Typed Hubs
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…]
ASP.NET Core 2.2 SignalR Server
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…]
ASP.NET Core Unit Testing – Setting the request body
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…]
Callback MemoryStream
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…]
ASP.NET Core Web API–Returning a FileStream
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…]
ASP.NET Core 2–Enabling SignalR logging
Sometimes you just need some logging to do a sanity check that things are actually working the way that you’re expecting. via GIPHY Here’s how to turn logging on in ASP.NET Core 2 for SignalR: I’ve had to look this up more than twice, and its not exactly easy to find in the Microsoft docs, … [Read more…]
Uploading a file from a website
Uploading a file from a website is pretty simple, but I always have to look it up. There’s all sorts of different technologies and frameworks that work with the web, so I just thought I would write down how I got it to work so that next time I can just come back here and … [Read more…]