Dynamic Programming in C# 10
C# is a statically typed language but it also has (often overlooked) dynamic features. This course will teach you to use dynamic C# to make some difficult and cumbersome programming tasks easier and allow you to create more flexible C# applications.
What you'll learn
The statically typed nature of C# helps prevent bugs but can make some programming tasks harder and some types of applications more difficult to write. In this course, Dynamic Programming in C# 10, you’ll gain the ability to make difficult or time-consuming programming tasks easier and help you create applications where data structures are not known at compile time. First, you’ll explore how to create and work with dynamic object instances. Next, you’ll discover how dynamic C# can make applications easier and quicker to create. Finally, you’ll learn how to create your own custom dynamic classes and how to take advance of features from other dynamic languages from right inside your C# code. When you’re finished with this course, you’ll have the skills and knowledge of dynamic C# needed to make difficult and cumbersome programming tasks easier and allow you to create more flexible C# applications.
Table of contents
- Introduction 2m
- Why Dynamic C#? 4m
- Introducing the DLR 3m
- Static and Dynamic Binding 3m
- Dynamic Binding in Action and RuntimeBinderException 4m
- Implicit Dynamic Conversions 5m
- Checkpoint 01 - Add an Explicit Cast 0m
- Var and Dynamic 2m
- Runtime Method Resolution 5m
- C Sharp 10 Dynamic Programming 1m
- Limitations of Callable Methods 4m
- Introducing ExpandoObject 1m
- Using an ExpandoObject 5m
- Checkpoint 02 - Add Dynamic Properties to an ExpandoObject Instance 0m
- Dynamically Adding ExpandoObject Behavior 1m
- Exercise 01 - Create a Console Application That Allows Data to Be Captured Dynamically at Runtime 0m
- Summary 2m
- Introduction 1m
- Simplifying Reflection Code with Dynamic C# 6m
- Checkpoint 03 - Call a Method on an Object Using Dynamic C# Instead of Reflection Code 0m
- Performing COM Interop without Interop Assemblies 3m
- Reducing Boilerplate Code with Dynamic JSON 3m
- Dynamic SQL Query Results with Dapper 4m
- Dynamic Code Considerations 1m
- Exercise 02 - Write a Console Application to Parse JSON Data Dynamically and Output the JSON Data to the Console Window 0m
- Summary 1m
- Introduction 2m
- Why Custom Dynamic Classes? 2m
- The IDynamicMetaObjectProvider Interface 1m
- The DynamicObject Base Class 3m
- Getting Started 4m
- Adding Initial Dynamic Capabilities 5m
- Checkpoint 04 - Inherit From the Correct Base Class When Defining a Custom Dynamic Class 0m
- Dynamic Operation Exceptions 4m
- Improving the Debugger Experience 3m
- Overriding ToString 3m
- Implementing Additional Interfaces 2m
- Checkpoint 05 - Use the Correct Interface to Add IDictionary Support to a Custom Dynamic Class 0m
- Making the Dynamic Object Enumerable 1m
- Responding to Dynamic Method Invocations 2m
- Method Invocation Precedence 2m
- Invoking the Dynamic Object Itself 2m
- Using the Custom Dynamic Object 3m
- Exercise 03 - Create a Custom Dynamic C# Class 0m
- Summary 2m
- Introduction 1m
- Why Dynamic Interop? 2m
- Getting Started with IronPython 2m
- Checkpoint 06 - Add IronPython Support to a Console Application 0m
- Getting Scripting Input from the User 4m
- Scripting Risks 0m
- Executing Python Statements 2m
- Checkpoint 07 - Evaluate a Simple Python Expression in C# 0m
- Interacting with Python Objects 2m
- Passing Custom Dynamic Objects to Python 3m
- Exercise 04 - Write Code to Interact with IronPython 0m
- Summary 1m