Working example of calling the WeatherKit REST API in C#/.NET.
Continue reading »Tag: C#
ASP.NET MongoDB Example
Here's a working example of using MongoDB with ASP.NET / C# that demonstrates all the basic operations in MongoDB and encapsulates them in Web API. The example application is a simple Todo list. It's pretty simplistic, but it's more or less the pattern I'm using right now for data access against MongoDB.
Continue reading »Adding Image Watermark Text in C# with ImageSharp
There may be times you want to add a watermark, or a bit of text, to an image programmatically. Here's how to do that with ImageSharp. As of the this writing, it requires a couple pre-release NuGet packages, but the ImageSharp libraries seem to work pretty well for at least basic use.
Here's some example code to load an image and draw some watermark text on it.
Continue reading »MapKit JS with ASP.NET Core
Apple's MapKit JS isn't currently as widely used as some alternative web mapping solutions, but it's a reasonable option, depending on your needs. While there's no free version, the usage limits are very high, and it's priced more competitively than many rivals, since it's included with an Apple Developer Membership. Integrating MapKit JS with an ASP.NET Core application is a little different at first, if you've never worked with JWT, but it's actually pretty straightforward.
Continue reading »ASP.NET Core: Logging with Serilog to MongoDB Using Configuration
This is likely a bit esoteric, but I was setting up an ASP.NET Core 2.2 project recently where I wanted to store logs in MongoDB. I wanted to play with Serilog vs. some of the alternatives. I also wanted to use a configuration file, and I wasn't able to find any good examples online, so I figured I'd create a quick example in this post. This example is applicable to ASP.NET Core 2.2, and may work for other versions, but isn't tested with others.
Continue reading »