You've Been Haacked - RSS Feed

Latest articles

When Your DbContext Has The Wrong Scope

This is the final installment of the adventures of Bill Maack the Hapless Developer (any similarity to me is purely coincidental and a result of pure random chance in an infinite universe). Follow along as Bill continues to improve the reliability of his ASP.NET Core and Entity Framework Core code. If you haven’t read the previous installments, you...

Why Did That Database Throw That Exception?

In the previous installment of the adventures of the hapless developer, Bill Maack, Bill faced some code that tries to recover from a race condition when creating a User if the User entity doesn’t already exist. As a reminder, these events are based on real events with real production code, but with names, locations, and code changed to protect the...

How to Recover from a DbUpdateException With EF Core

There are cases where recovery from an Entity Framework Core (EF Core) DbUpdateException is possible if you play your cards right. Play them wrong and the result is heartbreak and tears as every call to SaveChangesAsync rethrows the same exception. The following story examines one example of heartache and tears. This story is based on actual events....

C# List Pattern Examples

We recently upgraded Abbot to .NET 7 and C# 11 and I’m just loving the new language features in C#. In this post, I’ll give a couple examples of list patterns. Single Item List There are cases where I expect up to one item in a list. Any more and I want to throw an exception. Here’s one way you can deal with it: BEFORE List<int>...

So you want to speak at conferences

I just finished speaking at my favorite conference, the Caribbean Developer’s Conference. Held in a wonderful resort in Punta Cana, Dominican Republic, it brings together a local and international crowd of speakers and attendees. I’ve gushed about it before. Wonderful locations are certainly a perk of some conferences, but what really gets me jazzed...

Calculating MRR with Stripe and C#

Over here at A Serious Business, Inc. we’re very serious about security. One principle that’s important to us is what we call the Principle of Least Exposure (not to be confused with the similar Principle of Least Privilege). In simple terms, the principle is: You can’t expose what you don’t have. For example, our product Abbot doesn’t...

Pitfalls with eager loading of collections in EF Core

When using an ORM with a web app, lazy loading will almost certainly result in hidden N+1 queries. Eager loading is a great way to avoid this, but has its own pitfalls. In particular, for each query, you need to be careful about what you include in the query. If you include too much, you can end up with a lot of data that you don’t need. If you include...

Tag Helper for Display Templates

I was minding my own business when @dahlbyk (you may know him from such hits as PoshGit) dropped this comment on an already merged pull request. Display Templates? Now there’s a name I haven’t heard in a long time. As a refresher, Display and Editor Templates were first introduced as part of ASP.NET MVC. You could place partial views in the Views/Shared/DisplayTemplates...

Lessons From a Startup Pivot

Building a startup is easy. You file some paperwork and bam! You’re a startup! Building a start-up that’s sustainable and can pay everyone a nice salary, on the other hand, is very tough. We are launching Abbot on Product Hunt today, and preparing last week made me reflect on some of the lessons we’ve learned since starting our business. Abbot...

Lessons From a Startup Pivot

Building a startup is easy. You file some paperwork and bam! You’re a startup! Building a start-up that’s sustainable and can pay everyone a nice salary, on the other hand, is very tough. We are launching Abbot on Product Hunt today, and preparing last week made me reflect on some of the lessons we’ve learned since starting our business. Abbot...

Discover, share and read the best on the web

Follow RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters! Get unfiltered news feeds or filter them to your liking.

Get Inoreader
Inoreader - Follow RSS Feeds, Blogs, Podcasts, Twitter searches, Facebook pages, even Email Newsletters!