Essential .NET – Configuration in .NET Core (MSDN)

,
February 4, 2016 / No Comment

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 […]
Read more

AUTHOR: CATEGORY: .Net, Blog, Headlines

Self-Hosted Integration Testing Of OData and WebApi

,
January 15, 2016 / No Comment

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 […]
Read more

AUTHOR: CATEGORY: .Net, ASP.Net, Blog, C#

Essential .NET – C# Scripting (MSDN)

,
January 6, 2016 / No Comment

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 […]
Read more

AUTHOR: CATEGORY: .Net, Blog, C#, Headlines

Display a Custom Tooltip at the Mouse Position on a Large WPF Control

,
December 16, 2015 / No Comment

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 […]
Read more

AUTHOR: CATEGORY: .Net, Blog, C#

Designing C# 7

,
December 9, 2015 / No Comment

“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 […]
Read more

AUTHOR: CATEGORY: .Net, Blog, C#

Reducing Boilerplate Code with ReSharper Templates

,
November 17, 2015 / No Comment

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 […]
Read more

AUTHOR: CATEGORY: Blog, C#

C# Exception Handling

,
November 9, 2015 / No Comment

“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 […]
Read more

AUTHOR: CATEGORY: .Net, Blog, C#

How I Became A Vim Rockstar In Visual Studio

,
September 23, 2015 / 1 Comment

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 […]
Read more

AUTHOR: CATEGORY: Blog, C#, Visual Studio

Guidelines for Exception Handling in C#

,
September 14, 2015 / 1 Comment

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.
Read more

AUTHOR: CATEGORY: .Net, C#