Processing Google reCaptcha Tokens in ASP.NET Core

Integrating a simple test to help prevent malignant input on your site is as simple as integrating a few lines of code into your website.

Now, if I could I’d pinch myself to make sure I’m not a robot, but I know very well that if I’m smart enough to think of that, they must have also programmed a sense of touch and pain into me as well. So testing to see if a website user is going to be even more daunting, because we can’t even pinch them.

Thankfully, the reCaptcha service offered by Google is free add-on to your site that will help to avoid bad data getting into your site, prevent malicious users from gaining access to your resources, and helping you to avoid unwanted side effects of bots that pile up junk data through your forms.

Read on to see how to get this all wired up in a Razor Pages application in ASP.NET Core. Heck, if you are in an MVC app or are building a Web API (or Azure Function) this would all still serve useful!

Read More

No Type Was Specified for the Decimal Column

When you create an entity for a database context in Entity Framework that has a decimal column, you may run into problems with truncation happening silently to you behind the scenes. With a default precision of 18 digits and 2 decimal places you may lose some data and the framework/runtime won’t complain about it when you do.

You can fix that though data annotations or with an explicit wire-up in your database context. Let’s look at how that’s done.

Read More

Removing Bower - The command "bower install" exited with code 1 When Publishing

I was cleaning up and updating the JS package management in a project that has shuffled along from ASP.NET Core 1.0 (and runs on .NET 4.6) and everything seemed to be going fine. And then I tried to publish.

Publish has encountered an error. Build failed. Check the Output window for more details.

Upon further examination, I noticed that there was a problem with an msbuild task, namely PrepublishScript.

Read More

BakeBot Day 1: What a Bot Is (And What It Is Not)

One of the most important things in bot creation is understanding what a bot should actually be. The last thing we want to do is to over extend ourselves. Complexity is always the enemy when we’re working on software, and bots have a very real human component in their routing operation that makes things complex enough on their own without us adding in any extra.

BakeBot at Chez Angela

Before we dive into building a bot, let’s start by getting on the same page of understanding and filling in some background details. If nothing else, this will give you visibility into why I’ve approached things the way I have.

Read More

BakeBot - A Bot for our Bakery Built with the Microsoft Bot Framework

As our small business grew we increasingly found that customers had the same types of questions over and over again. To help our bakery grow while staying engaged with social media (and to avoid significant labor costs in repetitive actions) we built a “bakery bot” or BakeBot.

In this blog series we’ll walk through the concepts, design and code required to build a bot using the Microsoft Bot Framework. We’ll leverage several Azure services to add value to the conversation with our customers by using data we’ve already got in our organization.

BakeBot at Chez Angela

Read More