New Pluralsight Course: Working with Data and Schemas in Marten

Marten is a .NET document database library to allows objects to be stored, retrieved, and queried as documents stored as JSON in an underlying PostgreSQL database. This new course is a follow-on from the previous Getting Started with .NET Document Databases Using Marten course, if you’re new to Marten I’d recommend checking out the previous course first before continuing with this new one.

Among other topics, this new course covers how to log/diagnose the SQL that is being issued to PostgreSQL; how to enable offline optimistic concurrency; bulk document inserts; a number of ways to improve query performance; and the customization of database schema objects.

You can check out the new course on the Pluralsight site.

New Pluralsight Course: Testing C# Code in Production with Scientist.NET

My latest Pluralsight course is now available for viewing. It demonstrates how to use the Scientist.NET library to execute candidate code in production alongside the existing production code. This allows the new candidate code to be additionally verified as able to work in production (for example with production data that may be of variable quality) and offers an additional check in addition to automated tests that have been executed in the development/QA environment.

From the course description: “Errors in production code can be costly to fix, more stressful for the development team, and frustrating for the end-user. In this course, Testing C# Code in Production with Scientist.NET, you will get to see how Scientist.NET allows sections of the application to be changed more safely by running both the existing code alongside the new code in production. You'll begin with an introduction to Scientist.NET before installing it and writing your first experiment. Next, you'll learn how to customize the configuration of experiments. Finally, you'll learn how to publish experiment data to SQL Server and analyze experiment results…”

You can check out the new course here.

New Pluralsight Course: Working with Nulls in C#

My latest Pluralsight course is now available for viewing. It covers the fundamental aspects of working with nulls in C# code.

From the course description: “Unexpected null values and NullReferenceExceptions can be a constant source of bugs resulting in wasted time and out of hours support callouts. In this course, Working with Nulls in C#, you're going to learn about the different ways that null values pop up in C# code and how to deal with them. First, you're going to learn the fundamentals of why you get null values and the difference between value and reference types. Next you'll learn how you can use the various C# operators to check for and manipulate nulls. Finally, you'll learn how to think about nulls at a higher abstraction level in your object-oriented code. By the end of this course, you'll understand the different types of objects in C#, how to correctly create nullable value types, how to use C# operators to work with nulls with fewer lines of code, and how to implement the Null Object pattern to remove the need to write repetitive null checking code.”

You can check out the course here.

New Pluralsight Course: Dynamic C# Fundamentals

My Pluralsight course “Dynamic C# Fundamentals” is now available.

The course is split into 4 modules:

Module 1 introduces the dynamic features of C# and how it is enabled by the Dynamic Language Runtime (DLR).

Module 2 looks at numerous places that dynamic C# can be used including COM, XAML, MVC, and JSON.

Module 3 digs into more detail and shows how to create custom C# classes that can exhibit dynamic behaviour.

Module 4 shows how the DLR enables C# to interoperate with other dynamic languages such as IronPython.

Full list of topics:

1 Introducing Dynamic C#

  • Why Dynamic C#?
  • Course Outline
  • Introducing the DLR
  • Static and Dynamic Binding
  • Dynamic Binding in Action and RuntimeBinderException
  • Implicit Dynamic Conversions
  • Var and Dynamic
  • Runtime Method Resolution
  • Dynamic and Object Types
  • Limitations of Callable Methods
  • Introducing ExpandoObject
  • Refactoring to Dynamic
  • Dynamically Adding ExpandoObject Behavior

2 Simplifying Code with Dynamic C#

  • Simplifying Reflection Code
  • Reducing Code with Unified Numeric Methods
  • COM Interop Without Interop Assemblies
  • Reducing Plumbing Code with Dynamic JSON
  • Dynamically Populating Excel with Arbitrary JSON Data
  • Dynamic JSON in Web API
  • ExpandoObject and XAML Databinding
  • Dynamic SQL Query Results with Dapper
  • Improving SpecFlow Test Code with Dynamics
  • Dynamic Code Considerations

3 Creating Custom Dynamic Classes

  • Why Custom Dynamic Classes?
  • The IDynamicMetaObjectProvider Interface
  • The DynamicObject Base Class
  • Creating a Dynamic HtmlElement Class
  • Creating the First Test
  • Adding Initial Dynamic Capabilities
  • Dynamic Operation Exceptions
  • Improving the Debugger Experience
  • Overriding ToString
  • Implementing Additional Interfaces
  • Making the Dynamic Object Enumerable
  • Implementing Dynamic Methods
  • Method Invocation Precedence
  • Invoking the Dynamic Object Itself

4 Interoperating with Dynamic Languages

  • Why Dynamic Interop?
  • Getting Started with IronPython
  • Getting Scripting Input from the User
  • Scripting Risks
  • Executing Python Statements
  • Interacting with Python Objects
  • Passing Custom Dynamic Objects to Python

Check out the full course description.

New Pluralsight Course: Automated Business Readable Web Tests with Selenium and SpecFlow

SpecFlow is a tool that can translate natural language scenarios (e.g. writing in English or other spoken languages) into test code. This can allow business people, users, or other stakeholders to verify that the correct features are being built.

Selenium is a tool that allows test code (multiple programming languages supported) to automated a web browser. This allows the creation of automated UI tests that operate the web application as if an end user where doing it; for example clicking buttons and typing text into input boxes.

My new Pluralsight course shows how to integrate these two tools.

The course is organized into four modules:

  1. Introduction to Business Readable Web Testing
  2. Getting Started with Selenium
  3. Adding Business Readability with SpecFlow
  4. Creating More Maintainable Web Automation

If you’re new to SpecFlow I suggest watching this course first before moving on to Automated Business Readable Web Tests with Selenium and SpecFlow.

New Pluralsight Course: Business Readable Automated Tests with SpecFlow 2.0

My newest Pluralsight course was just published. Business Readable Automated Tests with SpecFlow 2.0 teaches how to create tests that the business can read, understand, and contribute to. These “English-like” tests (other spoken languages are supported) can be executed by writing test code that is associated with the “English-like” steps. Because the tests sit alongside the source code, they can become living (executable) documentation for the system, as opposed to an out-of-date Word document somewhere on the network for example. Check out the course here.

New Pluralsight Course: Getting Started Building Windows Services with Topshelf

My newest Pluralsight course “Getting Started Building Windows Services with Topshelf” has just been released.

Topshelf is an open source library that makes it easier to develop, test, and install Windows Services.

If you’re new to Windows Services, the course starts by introducing how Windows Services work and some of their features such as automatic service recovery and the ability to run in the background as different users.

The course then goes on to cover how to create a Windows Service with Topshelf as well as additional techniques such as debugging, logging, pause and continue and the ability to send custom commands to running services.

Check out the course link or browse all my Pluralsight courses.

30 Pluralsight Courses

My new Pluralsight course Stateful Reactive Concurrent SPAs with SignalR and Akka.NET was just published, this brings my total number of courses to 30.

I’ve always loved teaching and sharing and being a Pluralsight author is a great way to continue to do this.

I’d also like to take a moment to say a thankyou to everyone that’s watched my courses and for all the kind words. Thank you.

New Pluralsight Course: Implementing Logging and Dependency Injection in Akka.NET

If you’ve already watched my Akka.NET fundamentals Pluralsight course and want to learn more about using DI and logging, check out my new Implementing Logging and Dependency Injection in Akka.NET course.

Course Description

Akka.NET makes building concurrent and distributed applications easier. As with other architectures, Akka.NET based systems need effective logging for the monitoring and diagnosing of systems when deployed to production. Just because we use Akka.NET to get the benefits of the Actor Model, it doesn’t mean that best practices for object construction and dependencies such as dependency injection should be ignored. By the end of the course, you’ll understand how to implement effective logging in your Akka.NET system and how to use dependency injection to ensure the services your actors depend on are still provided in a loosely coupled and configurable way.

Better User Experiences and More Robust Applications Pluralsight Course

My new Pluralsight course was just published which shows how to use the open source Polly library.

Polly is a great library by Michael Wolfenden for configuring the automatic retrying of operations if exceptions occur. Transient errors such as the network being slow/unavailable for a small amount of time can normally result in errors surfacing to the user and/or into log files that need looking at.

By using one of the exception handling strategies that Polly provides, these transient exceptions can automatically be retried, preventing user errors and/or log entries.

There are four strategies:

  • Retry Forever
  • Retry
  • Wait and Retry
  • Circuit Breaker

Polly is configured in a fluent way, for example to use the Wait and Retry strategy to retry 3 times waiting 2, 4, and 6 seconds between retries:

Policy.Handle<some exception>()
      .WaitAndRetry(new[]
          {
            TimeSpan.FromSeconds(2),
            TimeSpan.FromSeconds(4),
            TimeSpan.FromSeconds(6)
          })
      .Execute(some action);

Check out the Polly GitHub repo, the NuGet package or the “Better User Experiences and More Robust Applications with Polly” Pluralsight course.