Join us and learn!
Note: Just prior to press time, Microsoft announced name changes to ASP.NET 5 and related stacks. ASP.NET 5 is now ASP.NET Core 1.0. Entity Framework (EF) 7 is now Entity Framework (EF) Core 1.0. The ASP.NET 5 and EF7 packages and namespaces will change, but otherwise the new nomenclature has no impact on the lessons of this article.
Those of […]
Full-stack testing of OData 4.0 and Web API 2.2 ASP.Net MVC controllers
Why Are Unit Tests of OData Web API Controllers Insufficient?
A common pattern for testing ASP.Net Web API 2 controller methods is to call them directly after mocking or setting up the Request and Configuration properties. When OData v4 is then added to this mix, more setup or […]
With the arrival of Visual Studio 2015 Update 1, henceforth Update 1, comes a new C# read-evaluate-print-loop (REPL), available as a new interactive window within Visual Studio 2015 or as a new command-line interface (CLI) called CSI. In addition to bringing the C# language to the command line, Update 1 also introduces a new C# scripting language, traditionally saved into […]
In my work for an electric utility, we have a WPF based map control used to show the location of power lines, along with other devices such as transformers and points of service. We wanted to show a tooltip when a user clicks on one of the power lines to identify what is called the “feeder”, which essentially defines the […]
“By the time you read this, the C# 7 design team will have been discussing, planning, experimenting and programming for about a year. In this installment, I’ll sample some of the ideas they’ve been exploring.
In reviewing, be mindful that at this time these are still ideas for what to include in C# 7. Some of the ideas the team […]
We all like to be efficient. Writing boilerplate code (that stuff you have to write to make everything work) is one such task that I am always looking to reduce or eliminate. One of the easiest ways I have found is by using a feature in ReSharper called Code Templates. There are several different types of templates, but I would […]
“C# 6.0 included two new exception handling features. First, it included support for exception conditions—the ability to provide an expression that filters out an exception from entering catch block before the stack unwinds. Second, it included async support from within a catch block, something that wasn’t possible in C# 5.0 when async was added to the language. In addition, there […]
A Brief History Lesson
As a software developer, we spend a lot of our time using text editors. Most text editors follow the Emacs standard that harkens all the way back to the 1970s and the venerable PDP-10. Emacs’ WYSIWYG style of editing is best suited to a stream-of-consciousness and linear style of editing. The focus is, foremost, on being […]
The following is a list of C# Exceptions Handling Guidelines taken from Essential C# by Mark Michaelis.
Exception handling provides much-needed structure to the error-handling mechanisms that preceded it. However, it can still lead to some unwieldy results if used haphazardly. The following guidelines offer some best practices for exception handling.
Catch only the exceptions that you can handle.