Helping you solve those tough coding problems!
Learn some great web development and web design tips and techniques through recipes that clearly define the problem being solved with a working solution.
Popular Tags: cakephp | theory | optimization | javascript-development | asp-net | css | jquery-development | sql | ajax | c

Search:
Follow @endyourif rss Facebook LinkedIn

Web API Global Exception Handler using an ExceptionFilterAttribute filter Web API Global Exception Handler using an ExceptionFilterAttribute filter

Published on Apr 19, 2019 by Jamie Munro

Web API and MVC with C# offer stellar global filters that can be registered in the App_Start/FilterConfig.cs file. For Web API and MVC the global filters goes inside the RegisterGlobalFilters function. This function contains an override based on whether you are applying the filter to MVC or Web API. Today we are going to look at how to implement an extension filter of the ExceptionFilterAttribute.

Read more >

Tags: Uncategorized | ASP.NET | web api | exceptionattributefilter

Preventing race conditions with sp_getapplock Preventing race conditions with sp_getapplock

Published on Apr 17, 2019 by Jamie Munro

I am a big proponent of storing calculated fields in the database opposed to calculating them each time they are displayed. They only change at specific times so you just need to cover those spots to calculate them. The danger with storing calculated fields is that concurrent calls have a chance incorrectly calculating the field. Languages such as C# offer the ability to lock objects to help with this. However, in a multi-server example, locking on a single server will not work. In this article I'm going to demonstrate how to use sp_getapplock to prevent race conditions.

Read more >

Tags: SQL | Entity Framework | ASP.NET | mssql | sp_getapplock

Dependent DLL is not getting copied to the build output folder in Visual Studio Dependent DLL is not getting copied to the build output folder in Visual Studio

Published on Apr 14, 2019 by Jamie Munro

I was struggling the other day where one of my NuGet packages DLL that was installed in a separate MVC project was not being copied to my bin directory. I have discovered two potentially reasons why this was occurring. Read on for two different potential solutions.

Read more >

Tags: dll | ASP.NET | c#

Two different versions of the same DLL with C# Two different versions of the same DLL with C#

Published on Apr 13, 2019 by Jamie Munro

Recently I was stuck with the error Try removing one of the references or sign them to enable side-by-side. This is not a common error, but I received it because I was in the very unfortunate situation of requiring to have two different versions of the same DLL installed in my solution. Let's explore how I worked around this.

Read more >

Tags: dll | ASP.NET | c#

Creating a Windows Self-Signed SSL Certificate for use with IIS Creating a Windows Self-Signed SSL Certificate for use with IIS

Published on Apr 12, 2019 by Jamie Munro

I recently showed how to setup an SSL certificate using nginx, in this article I will demonstrate how to create a Self-Signed SSL certificate that can be used with IIS.

Read more >

Tags: ASP.NET | ssl

Specflow Steps are not binding or show up red Specflow Steps are not binding or show up red

Published on Apr 11, 2019 by Jamie Munro

HtmlHelper Extenstion to convert an object to JSON with C# HtmlHelper Extenstion to convert an object to JSON with C#

Published on Apr 10, 2019 by Jamie Munro

Controller does not have a default constructor Controller does not have a default constructor

Published on Apr 8, 2019 by Jamie Munro

C# Convert any value to a boolean C# Convert any value to a boolean

Published on Apr 5, 2019 by Jamie Munro

C# Ordinal String Extension C# Ordinal String Extension

Published on Mar 29, 2019 by Jamie Munro

C# - Convert an Enum to a list C# - Convert an Enum to a list

Published on Mar 27, 2019 by Jamie Munro

Entity Framework's Code-First with an ObjectContext Entity Framework's Code-First with an ObjectContext

Published on Mar 20, 2019 by Jamie Munro

Posting form variables that are not strongly typed with MVC Posting form variables that are not strongly typed with MVC

Published on Mar 17, 2019 by Jamie Munro

Pass Model or Form Data with MVC when redirecting Pass Model or Form Data with MVC when redirecting

Published on Mar 13, 2019 by Jamie Munro

Creating your own UrlHelper Extension with MVC Creating your own UrlHelper Extension with MVC

Published on Mar 9, 2019 by Jamie Munro

Compile Views with your MVC project Compile Views with your MVC project

Published on Mar 6, 2019 by Jamie Munro

C# Truncate String Extension C# Truncate String Extension

Published on Feb 28, 2019 by Jamie Munro

MVC: Accessing the RouteData inside of your C# code MVC: Accessing the RouteData inside of your C# code

Published on Feb 27, 2019 by Jamie Munro

C# HtmlExtension to display SVGs C# HtmlExtension to display SVGs

Published on Feb 16, 2019 by Jamie Munro

C# Improving string.IsNullOrEmpty readability C# Improving string.IsNullOrEmpty readability

Published on Feb 5, 2019 by Jamie Munro

C# OutputCache with subdomains C# OutputCache with subdomains

Published on May 4, 2018 by Jamie Munro

C# Convert date from UTC to EST C# Convert date from UTC to EST

Published on Jun 7, 2017 by Jamie Munro

How to return a CSV from ASP.NET Web API using C# How to return a CSV from ASP.NET Web API using C#

Published on May 4, 2017 by Jamie Munro

Unit Testing Data Validation with MVC Unit Testing Data Validation with MVC

Published on May 11, 2015 by Jamie Munro

Removing Data Validation from MVC Controllers Removing Data Validation from MVC Controllers

Published on May 6, 2015 by Jamie Munro

Integrating Automapper with an MVC Result Filter Integrating Automapper with an MVC Result Filter

Published on May 4, 2015 by Jamie Munro

ASP.NET MVC 5 with Bootstrap and Knockout.js ASP.NET MVC 5 with Bootstrap and Knockout.js

Published on Apr 21, 2015 by Jamie Munro

Speeding up my unit tests Speeding up my unit tests

Published on Apr 28, 2014 by Jamie Munro

Advanced Automatic Ninject Bindings Advanced Automatic Ninject Bindings

Published on Jan 13, 2014 by Jamie Munro

Automatic Ninject Bindings Automatic Ninject Bindings

Published on Jan 7, 2014 by Jamie Munro

Iím hooked on test-driven development (TDD) with a Fizzbuzz C# Example Iím hooked on test-driven development (TDD) with a Fizzbuzz C# Example

Published on Aug 6, 2013 by Jamie Munro

Automapper Performance Testing Automapper Performance Testing

Published on May 27, 2013 by Jamie Munro

Why the Repository Pattern Why the Repository Pattern

Published on May 20, 2013 by Jamie Munro

Entity Framework Beginnerís Guide Done Right Entity Framework Beginnerís Guide Done Right

Published on May 13, 2013 by Jamie Munro

My First Experiences with Kinect for Windows - @KinectWindows My First Experiences with Kinect for Windows - @KinectWindows

Published on Mar 5, 2013 by Jamie Munro

Javascript, the Back Button, and Windows Phone 8 Development Javascript, the Back Button, and Windows Phone 8 Development

Published on Feb 18, 2013 by Jamie Munro

The Best Way to Prevent SQL Injection The Best Way to Prevent SQL Injection

Published on Sep 19, 2012 by Jamie Munro

What I Learned This Summer What I Learned This Summer

Published on Sep 7, 2012 by Jamie Munro

A Simple But Effective Speed Comparison A Simple But Effective Speed Comparison

Published on Sep 4, 2012 by Jamie Munro

MVC 3 Routing Example MVC 3 Routing Example

Published on Oct 17, 2011 by Jamie Munro

20 Recipes for Programming MVC 3 20 Recipes for Programming MVC 3

Published on Oct 12, 2011 by Jamie Munro

20 Recipes for Programming MVC 3 20 Recipes for Programming MVC 3

Published on Oct 12, 2011 by Jamie Munro

ToLower-ToUpper and the CurrentCulture.CultureInfo ToLower-ToUpper and the CurrentCulture.CultureInfo

Published on Aug 8, 2011 by Jamie Munro

ToLower-ToUpper and the CurrentCulture.CultureInfo ToLower-ToUpper and the CurrentCulture.CultureInfo

Published on Aug 8, 2011 by Jamie Munro