Execute Raw SQL Scripts in Entity Framework Core

Most of the time, Entity Framework Core will just do the right thing. Every now and then, though, you’ll find that it’s doing something in a bit of a sticky way and you’ll want to take control. Usually it’s when you’re deleting a range on a table with cascading deletes. Here’s an example of theContinue reading “Execute Raw SQL Scripts in Entity Framework Core”

Simple Conditional Updates to Entities in ASP.NET Core MVC

When you accept a view model in your .NET Core MVC application, you can request that only certain fields are bound, like this [Bind(“Title”)]. Neat. But when you want to apply the changes to your domain object, you often want to do a similar thing and only update certain fields (and only if they reallyContinue reading “Simple Conditional Updates to Entities in ASP.NET Core MVC”

The type or namespace name ‘ApplicationInsights’ does not exist in the namespace ‘Microsoft’

If you uninstall the Application Insights package from a .NET Core MVC project, you might get a few errors as it can’t “remove all the references” that might have made it into your application. The changes to StartUp.cs will be pretty self-explantory, but elsewhere you will get something a bit more off-the-wall as it referencesContinue reading “The type or namespace name ‘ApplicationInsights’ does not exist in the namespace ‘Microsoft’”

IISExpress.exe Exited With Access Violation

I was happily typing away at some ASP.NET Core controllers and views, calling a view component to render out some paging links, when this happened… The program iisexpress.exe’ has exited with code -1073741819 (0xc0000005) ‘Access violation’. No exception visible in Visual Studio. No indication of where the error was. Nothing. The Internet supplied links toContinue reading “IISExpress.exe Exited With Access Violation”