How To


Introducing: Serverless C# with Azure Functions

Azure Functions get you beyond the traditional client/server approach to app creation, right into the cloud. Let’s first look at triggers.

Controlling Process Flow with the Template Method Pattern

If you have a process that needs to be performed -- but with variations -- then implementing the Template Method pattern will give you simpler, more extensible code. You’ll also recognize this pattern from all the times you work with it in the .NET Framework.

Getting All the Results in LINQ with Methods

Peter follows up on advice for joining collections with LINQ and getting all of the results, but this time, he uses the method-based syntax.

Adding New Formats to Old Data

The custom formatters in the .NET Framework provide a more seamless way to mix traditional and custom formatting situations.

The Focus Is on Architecting Modules in TypeScript 2.1

If you want to ensure that the right code is loaded at the right time (and only loaded when you need it), you can start organizing your TypeScript code into focused files right now.

C# and VB Data Conversion in a World of Cruel Users

While Visual Basic is a bit more forgiving with data conversions, you'll need to jump through some hoops to do similar conversions in C#.

Move Beyond Factory Methods with the Builder Pattern in C#/Visual Basic

When your objects get sufficiently complicated to create, it's time to simplify your life by moving to the Builder pattern. The Builder pattern is not only a great pattern for creating complicated objects, it supports your application's further evolution.

Errors on Unused Sections in ASP.NET MVC Views

If you don't use a section in a View, then you'll get an error. But you may not find out until it's too late.

Xamarin.Forms -- Caching for the ListView

Similar to the UITableView in iOS and ListView in Android, the XF version can be used to cache images for use in other locations of an application.

Investigating Exceptions Causing Web Site Havoc

A stepped approach using traditional tools in Visual Studio and third-party solutions to troubleshoot and debug Web application issues.

Checking Up on Your Entity Framework Objects with DbEntityEntry

The Entity Framework DbEntityEntry object lets you do all sorts of things you probably didn't think were possible, including getting the latest data from the database (without losing your current data) and invoking the .NET Framework validation subsystem.

Set HtmlHelpers Parameters Using Anonymous Objects in ASP.NET

If you're passing an anonymous object to an HtmlHelper method (to ActionLink, for example), you might want to consider using that anonymous object to eliminate one of the other parameters.

Revealing Secrets with R and Factor Analysis

Let's use this classical statistics technique -- and some R, of course -- to get to some of the latent variables hiding in your data.

Efficiently Loading Related Objects in Entity Framework

If you're not using the Entity Framework DbCollectionEntry object when working with an entity class's related objects, then your application is running too slow. Using DbCollectionEntry lets you asynchronously retrieve related objects and get only the objects you want.

Customize Browser Window Size When Debugging ASP.NET Apps

If, after pressing F5, you've ever found yourself adjusting the size of your browser window, then this tip is for you. But you shouldn't be surprised if it doesn't work.

Transforming Windows Files on C++: What's Fastest?

We just covered background information on our last file processing foray. Now, what's faster: CRT, Windows API, or something else?

Mimic Lazy Loading with Entity Framework 6 and Entity Framework Core 1.1

Entity Framework Core doesn't have lazy loading (at least, not yet). But you can fake it by using explicit loading, though it doesn't work quite the way you might want. In fact, it's probably a good idea to use this in Entity Framework 6.

Managing Modules in TypeScript 2.1

If you want to ensure that the right code is loaded at the right time (and only loaded when you need it), you can use TypeScript code to organize your code into modules. As a side benefit, managing your script tags will get considerably easier.

Solving UWP App-to-App Communication in IoT Apps

Writing Universal Windows Platform (UWP) apps that rely on inter-process communication is actually easy. Debugging and making them fault-tolerant is the tricky part, but it can be done with the AppServiceConnection for UWP and IoT Apps.

Selecting Groups in LINQ

Some questions can only be answered by organizing your data into groups and then finding groups that contain particular members or have particular properties.

Doing Visual Studio and .NET Code Documentation Right

Good documentation is important for any application, and it starts with documenting your code. It helps you and it helps your users.

Grouping Results in LINQ

Complex queries can be solved with a combination of simpler LINQ queries, anonymous objects and the Group/By/Into clauses. Using Group/By/Into will also give you the best possible performance for those complex queries.

Export Your ASP.NET Configuration To Reduce Restarts, Share Settings

You don't have to keep all your configuration settings in your config file. There are even some benefits to exporting sections to separate files.

Returning Raw JSON Data in Web API with Marten

Here's a trick to have Marten automatically deserialize JSON data only when you want it to.

Getting All the Results When Joining with LINQ

When you want to find all the objects that are missing a corresponding object, then you need the LINQ equivalent of an outer join. Here, step by painful step, is how to build that query.

Subscribe on YouTube