C# Corner Much emphasis has been placed on the new async capabilities in C# 5.0. However, there are smaller -- but still useful -- features of which you may not be aware. In my past two columns, I've covered a few of the features of the new async capabilities in the next version of C#. Async is an important feature and deserves the coverage it's getting. However, there are a few other neat little things Microsoft has added to C# that will help make your code cleaner and easier to maintain.
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by Patrick Steele
Top 7 Reasons To Love CoffeeScript
In-Depth Learn why more and more C# developers are turning to CoffeeScript to build their JavaScript-based Web applications. In my past two articles, ("Moving from Partial Views to AJAX Calls" and "JavaScript Data Binding with Knockout.js"), I've demonstrated some techniques to make it easier to develop Web-based applications. Today, I'm going to look at how using a language called CoffeeScript can help youwrite better JavaScript.
Unleash the Power of Chrome Developer Tools: A Tutorial
In-Depth Building and debugging Web-based applications with Chrome Developer Tools is easier than you might think. I spend a lot of my time in back-end C# code, so my JavaScript skills are a little rusty. Debugging client-side JavaScript and all of the back-and-forth Representational State Transfer (REST) calls isn't as easy for me as debugging C# in Visual Studio. That is, until I started using the Chrome Developer Tools. Google Inc.
Build Simple Web UIs with the Nancy Framework
C# Corner Use the open source Nancy Web framework to expose a Web-based configuration UI for a Windows service. If you've ever configured a router or used a modern-day network-enabled printer, you've probably noticed a lot of them expose a Web UI for configuration and administration. In this article, I'll show you how I used a similar technique to provide a configuration UI for a Windows service. Windows Services and UIs Windows services sit in the background and do work.
Moving from Partial Views to AJAX Calls
C# Corner Use AJAX and some JavaScript libraries to decouple your data and presentation logic. In this article, I'll take an ASP.NET application that uses partial views and convert it to use AJAX calls and some JavaScript templating. This will give me more options for how I can use the application in the future. Why Eliminate Partial Views? Is there something wrong with partial views? No, absolutely not. They're a great feature in ASP.NET MVC and they allow you to encapsulate view-rendering logic.
C# Corner -- Visual Studio Magazine
Eric Vogel provides step-by-step instructions to create an ASP.NET 5 Core web app in Visual Studio 2019 and embed a Power BI report in it. Eric Vogel uses code samples and screenshots to demonstrate how to do Entity Framework Core migrations in a .NET Core application through the command line and in code. Eric Vogel follows up on his previous post on getting started with ASP.NET Core security.
HTTP Basics for REST-Based App Development
Go inside the protocol that's the backbone for today's modern, cloud-based applications. While typing in a URL and pressing Enter inside a browser is effortless, there's a lot more going on behind the scenes. In this article, I'll review some of the basics of HTTP and show how they're being used in today's modern, REST-based applications. Tools of the Trade Examining the raw HTTP traffic that goes back and forth between a client and server is actually quite easy these days.
How to Automate IIS 7 Configuration with .NET
Are you tired of manually configuring IIS sites (adding Web sites, application pools, virtual directories and so on)? Use C# and the Microsoft.Web.Administration Namespace to simplify your life (or at least IIS configuration). I maintain a number of Web sites outside my day job. Nothing major -- a church Web site, a small PHP Web site for the salon my wife works at and a hot-lunch-ordering Web site for my kid's school.
Abstract and Delegate-based Factories -- Visual Studio Magazine
In part 2 of a series of columns on using factory patterns, Patrick Steele shows how factory patterns can be used to make your applications more flexible. In part 1 of this series , I began exploring software factory patterns and how they can be used to enable more flexible application code. In this installment, I'll look at abstract factories and delegate-based factories and how they can be used to support customizations.
Tips for Easier Unit Testing in C# -- Visual Studio Magazine
C# Corner columnist Patrick Steele says writing unit tests can be a time-consuming chore. He looks at some approaches that can make writing unit tests easier and more efficient for C# programmers. Many of the complaints of writing unit tests are that they take a long time to write or that they are "boring" to write. While I can't help conquer the "boring" part, this article will look at approaches that make writing unit tests easier so that you're more inclined to do it.
ServiceStack and Razor Forms
ServiceStack moves to a complete Web application framework with support for Razor forms. A few months ago, I wrote an article about using ServiceStack to breathe life into old ASP.NET Web Forms applications. Using ServiceStack, you could easily add REST support to Web Forms applications without having to deal with the headaches of running a combined Web Forms + MVC site. This time, let's look at ServiceStack Razor forms support -- making ServiceStack a complete Web application framework.
Factory Patterns in .NET (Part 3) -- Visual Studio Magazine
C# Corner columnist Patrick Steele concludes his exploration of factory patterns in .NET. In part 1 of this series, I began exploring software factory patterns and how they can be used to enable more flexible application architecture. Part 2 looked at abstract factories and delegate-based factories and how they can be used to support customizations.
Tips for Snagging That Senior Developer Job
You're vying for a senior developer position. Here's what you need to know to win over your interviewer. There comes a time when you decide to leave your current position. Perhaps it’s not as challenging technically or maybe the environment has changed. Maybe your employer is moving to a new technology stack and it’s not something that interests you. Whatever the reason, leaving one company and joining another is a big step.
Multithreading in WinForms
The .NET Framework has full support for running multiple threads at once. In this article, Patrick Steele looks at how threads accomplish their task and why you need to be careful how you manage a WinForms application with multiple threads. A user interface that is unresponsive will frustrate your users. If it goes on for too long, they bring up Task Manager and see the dreaded "(Not Responding)" next to your application.
Lambda Properties: An Alternative to Subclassing?
This article will introduce you to the concept of exposing parts of your application logic as lambda properties. By making these properties read/write, you can plug in specific functionality with more control than subclassing. We all know the power of subclassing. You define a base class with the necessary functionality and then extend that class by subclassing.
My Biggest C# Programming Mistake
C# Corner columnist Patrick Steele recounts an avoidable mistake he made during a transition from WebForms to ASP.NET MVC, and what he learned from his gaffe. In early 2009, the company I work for was offered the job of rewriting an old Web site that used ASP.NET WebForms. The site integrated with a SQL Server database as well as a SharePoint installation.
Object Equality in C# -- Visual Studio Magazine
Explore ways to override the default concepts of object equality, based on reference and value types, in the Microsoft .NET Framework. The subtle nuances of object equality in the Microsoft .NET Framework can make the results of equality comparisons in C# confusing at times. How can you ensure that objects and object references behave properly within an application -- and within the .NET Framework?
Using Expression Trees in Your APIs
How to translate C# code into expression trees to eliminate strings, standardize parameter validations and interact with other data structures. You've probably used expression trees before, but may not have realized it. Expression trees offer a convenient way to "examine" and "take apart" a lambda expression to find its parts. You can even execute the lambda (or not!) depending on your needs. Are you using expression trees today?
Shine Up Those Older Web Forms Applications with ServiceStack
So I've got an ASP.NET Web Forms application that needs maintaining. And it's still running the Microsoft .NET Framework 3.5. The size, complexity and availability of external components from third-party vendors make an upgrade to the .NET Framework 4 too risky. Am I stuck dealing with server-side controls and post backs? Heck, no! Thanks to ServiceStack, I can easily enhance that application. What Is ServiceStack?
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with Patrick
Contact Patrick, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack