
Introduce programming in c# for the dot net framework and outline the upcoming hours of study. Brian Roach leads the course overview Part 1 of Microsoft 70-483.
Explore the C# language in the .NET framework 4 or 5, covering object-oriented concepts, encapsulation, polymorphism, interfaces, and advanced topics like lambda expressions and the base class library, with WPF.
Introduce the Microsoft 70-483 course by outlining the C# language and the dot net framework, laying groundwork and providing a high level overview of upcoming topics.
Explore the dot net platform and its benefits, including platform independence, base class libraries, the common language runtime, and Windows 8 apps.
Compare the com object model's limitations with the dotnet platform, as desktop apps, web sites, services, and reusable libraries shift to a more powerful, language independent programming model.
Explore how the dot net platform enables interoperability across languages via a common runtime and the dynamic keyword, with a base class library and cross-language features like inheritance.
Define dot net types that expose only CLX compliant features so all dot net aware languages can consume them, and learn how to verify CLX compliance with the C-Sharp compiler.
Explore the Dot Net Framework's platform independence and how the common language infrastructure explains how this is possible.
Explore platform independence by running assemblies on Mac OS X, Linux, Solaris, iOS, Android via the mono touch API. Learn the C-sharp language, dotnet platform, and the common language infrastructure.
Understand how platform independence documents enable third parties to build distributions of the dominant platform across many operating systems and processors.
the dotnet base class library offers a comprehensive standard library for all cli languages, enabling file I/O, graphics, database interaction, and SML document manipulation.
Explore how C# blends C family of languages with Java-like syntax, yet isn’t a Java clone. Focus on properties, optional parameters, operator overloading, structures, enumerations, delegates, lambdas, and anonymous types.
Explore core C# features across versions, including garbage collection, no pointers, and attribute based programming, with generics, anonymous methods, lambdas, extension methods, and object initializers.
Explore core C# features, and learn how async and await simplify multi-threading and asynchronous programming, making asynchronous method calls as easy as invoking synchronous methods.
Understand how C# targets the dotnet runtime and uses assemblies for managed code, with unmanaged code outside the runtime, and that dotnet supports five managed languages.
Understand how the dot net runtime embraces multiple languages and lets developers share compiled code across teams, regardless of preferred syntax.
Explore how the .NET architecture unifies languages via the common language runtime and base libraries. See assemblies with manifests load into the CLR, enabling just-in-time managed code and garbage collection.
Explore how .NET binaries differ from unmanaged code, emphasizing platform-agnostic intermediate language and type metadata. Recognize that a .NET binary is called an assembly, with its basic properties.
Explore how .NET assemblies compile different languages into a common intermediate language with metadata and a manifest, enabling runtime execution, reflection, and tooling like IntelliSense.
Understand that an assembly can contain multiple distinct types in the dot net world, including classes, interfaces, structures, enumerations, and delegates.
Explore the common type system in dot net, detailing class types, interface types, structures, enumerations, and delegates.
Understand how delegates enable one object to forward calls to another, forming the foundation for the dotnet event architecture and enabling multicasting and asynchronous invocations on secondary threads.
Explore C# type members—constructors, finalizers, operators, nested types, methods, properties, fields, indexers, and events—and how visibility and static versus instance binding, plus abstract or virtual modifiers shape them.
Explore the common type system and its data types, and see how dot net languages express these CTX data types with different keywords, yet resolve to the same CTX type.
Explore intrinsic CTS data types in System namespace and their mapping to 32- and 64-bit numbers in C# and VB. Learn how CTX relates to numerics, strings, and booleans.
Explore how dot net languages express the same concepts, and why the common language specification provides a baseline for cross-language compatibility.
Explore the common language specification rules that enable cross-language interoperability in dotnet. See how rule 1 governs public exposure of a type while internal implementation may use non CLX techniques.
Load assemblies automatically, resolve their locations, and locate types via metadata before laying out memory and executing code with security checks. Collaborate with the base class library, notably core library.
Explore the end-to-end workflow of compiling source code with the dotnet compiler and executing it with the dotnet execution engine.
Discover how dot net libraries provide a language-neutral, well-organized code base for C# applications. Explore how namespaces group related types within assemblies to form a hierarchical structure.
Explore the object browser in Visual Studio to inspect assemblies, namespaces, types, and members, focusing on the System namespace and Microsoft root namespaces for Windows-specific types.
Explore how namespaces and the using keyword organize types in .NET, build a UI with Windows controls, shapes, and data access, and resolve types with fully qualified names.
Prefer using directives to shorten type names; using is a shorthand for fully qualified names, but remove unused usings to keep code compiling faster and static analysis leaner.
Specify a namespace with the using keyword and indicate the assembly that contains the actual type definitions, noting system drawing bitmap resides in a separate assembly and the GAC.
Explore how Windows 8 introduces a radically different user interface and new technologies, and examine how the platform's UI is structured within the Windows 8 ecosystem.
The lecture shows Windows 8's tiled layout with live tiles, touch-first, full-screen apps, and minimal chrome, designed for mobile and tablet use, contrasting with traditional desktop interfaces.
Understand that Windows 8 apps require Windows 8 and Visual Studio 2012. Install on Windows 8 to build and run Windows 8 applications, unlike Windows 7.
Demonstrates attempting to create a Windows 8 app in Visual Studio 2012 on a Windows 7 machine. Finds that Windows 8 templates are missing and investigates why.
Learn the Windows runtime for Windows 8 apps, featuring a new runtime layer with garbage collection across languages like C-sharp, and new Windows namespaces beginning with root windows.
Open Visual Studio 2012 on Windows 8 and create a new Windows Store app. Explore Windows namespaces and the .NET subset across C#, VB, JavaScript, or C++.
Review the framework and how dot net and C# simplify complexity through the runtime and base class library, CLR, IL, metadata, manifest, JIT, and the Common Language Specification.
Test your knowledge through scenario-based questions on .NET features, C# language details, and Windows runtime implications, including string builder versus concatenation, operator overloading, lambdas, and namespaces.
Build on a solid grounding in dot net by focusing on the C# language, its processes, and methodologies for using it.
Begin exploring basic constructs and methods in C# as we start coding hands-on. It lays groundwork for the remainder of our conversation and shows how programming in C# takes shape.
Explore building a C# program from the main method anatomy 101, learn data types, conversions (narrowing, widening, checked), var typing, methods, and arrays, including nullable types.
Explore how C-Sharp enforces that all program logic resides inside types (class, interface, struct, enum, delegate) and practice by creating a quick and dirty console app in Visual Studio.
Create a new Visual Studio console app and update the main method. Know that every executable C# program requires a class defining main as the entry point.
Explore static members and the main method signature with string[] args, then use Console.WriteLine and ReadLine from the System namespace to keep the Visual Studio console open during debugging.
Learn that C# is a case sensitive language, where keywords are lowercase and types use uppercase initial letters; check spelling and casing when you see compiler errors about undefined symbols.
Explore how the main method in a C# class or struct can have various entry point signatures beyond the default void and string[] input, depending on your needs.
Explore variations of the main method in C# by changing the return type and preserving a string array parameter, including void options and making main public when needed.
Understand how C# programs signal success or errors through exit codes, with zero indicating success and non-zero signaling failures. Learn to read exit code via System.Diagnostics.Process.ExitCode when launching an executable.
Learn to capture and return application error codes by making the main method return an int, using a batch file in Visual Studio to verify success (0).
Learn to process command line parameters by inspecting the incoming string array with a C# for loop in Visual Studio, extending your main method’s return value handling.
Explore iterating command line arguments in C# with a for loop and foreach, printing each item to the console, and running from Visual Studio with default arguments.
Explore the environment class and its static members to obtain details about the operating system hosting your dot net application, including additional properties of system data environment.
Demonstrates basic console IO with the System.Console class, using Write, WriteLine, Read, and ReadLine; prompts for name and age, echoes output, and changes the foreground color and background color.
Learn how the System.Console class formats strings with placeholders like {0} using runtime values, and how string.Format applies optional format characters after a colon.
Explore system data types in C# with their ranges, CLS compliance, and how to declare float, decimal, and long values using F, M, and L suffixes.
Explore how C# variables have storage locations and types that enforce type safety. Learn about assignment, the ++ operator, and declaring local variables within a member's scope in Visual Studio.
Declare and initialize local variables in C#, show single and multiple declarations, and apply default constructors with new; understand how System types derive from System.Object and value types.
Explore intrinsic C-Sharp numeric types, their min and max values, and special members like epsilon and infinity, and print these properties to the console, including boolean behavior.
C# textual data uses string and char, with string as a contiguous set of characters. Char holds a single slot, and System.String and System.Char expose static members for Unicode classification.
Explore the system namespaces and key data types such as date time and time span, plus BigInteger and complex structures, with practical Visual Studio demonstrations.
Learn how to work with big integers in C# by referencing System.Numerics, creating BigInteger values from text literals, and using static parse and operations like add and multiply.
Learn to work with system string data in C# using string methods like length, substrings, to upper and lower cases, contains, and replace, using both instance and static members.
Master string operations in C# by concatenating with + and using String.Concat, and by applying verbatim strings with @. Understand string equality by value, not reference.
Strings are immutable; most methods return a new string, not the original. Use stringbuilder from system.text to efficiently build text, with constructors for initial capacity and automatic growth.
Explore widening conversions that preserve the source value with no data loss, occurring implicitly, such as integral to decimal or char to string; note narrowing conversions may fail at runtime.
Explore widening and narrowing conversions in C# through a data conversion console, showing implicit upward casts from short to int, overflow risks, and explicit casts to handle data loss.
Demonstrate widening and narrowing conversions in C# by using implicit and explicit casts, show how data loss can occur, and explain how checked and unchecked keywords detect or prevent overflow.
Explore how the checked keyword detects overflow and underflow in arithmetic, preventing data loss when casting a short that exceeds its range, and triggering runtime exceptions you’ll handle with try-catch.
Wrap byte arithmetic in a try-catch to capture overflow exceptions, and use the checked keyword or a checked scope to enforce overflow checks.
Master how to control arithmetic overflow in C# using the checked and unchecked keywords in blocks, preventing silent overflow.
Enable the checked flag to detect arithmetic overflow at runtime in C#. Use Visual Studio, Advanced settings, and the overflow checkbox for debugging; disable it later for better performance.
Explore when data loss is acceptable and how checked and unchecked controls protect or disable overflow exceptions in C# arithmetic, including global versus location-specific checking.
Use checked and unchecked keywords to control arithmetic overflow in C#. The default ignores overflow; surround statements with checked to trap overflow, or use unchecked when overflow is acceptable.
Learn how to declare variables with explicit data types and use the var keyword for implicit typing; the compiler infers the type from the initial value, as shown in examples.
Explore implicit typing with var, letting the compiler infer a local variable’s type from its initial value, with restrictions including no use for return values, parameters, or fields.
Use implicitly typed local variables with var when a query may return dynamic or unknown type; implicit typing avoids exposing the underlying type, but skip var for simple int declarations.
Explore C# iteration constructs including the for loop, foreach loop, while loop, and do-while, and learn how to control terminating conditions and iterate over collections in practical examples.
Explore how to control program flow with if-else and switch statements in C# .NET, including boolean expressions, short-circuit operators, and switching on string or enum data to prevent fall-through.
Learn how to declare methods in C# as code blocks of statements, with access level, return value, name, and parameters separated by commas, where empty parentheses indicate none.
Explore constructing C# methods with out, ref, optional and named parameters, and method overloading; examine arrays, System.Array class, enumeration and structure types, the value and reference types and nullable types.
Explore defining methods in C#, control argument passing with by value, out, ref, and the params modifier, and see a multiply example that shows copies prevent caller data from changing.
Show how the out modifier returns values from a method (even with void return), compare with ref parameters, and cover assignment rules, initialization, and compiler errors.
Explain how to use the params keyword to accept a variable number of double arguments, auto-package them into an array, and compute their average with a single method call.
Learn how C-Sharp supports optional arguments, enabling defaults in method calls and simplifying COM object interactions, while placing optional parameters at the end to prevent compile-time errors.
Explore named arguments and named parameters in C# to call methods by name, leverage optional arguments, and understand order rules and the colon operator usage with practical examples.
Explore how C# supports method overloading, enabling identically named methods to differ by parameter count or type, and how generics and Visual Studio IntelliSense assist choosing the correct overload.
Explore how c# arrays represent contiguous data of the same type, accessed by a zero-based index. Fill by index or by curly brace initialization, noting default values when unfilled.
Explore array creation with curly braces in C#, where the size is inferred from the number of items, and the new keyword is optional when constructing arrays.
Explore arrays in C# with the var keyword, creating implicitly typed local arrays, and learn how mismatches between declared size and initializers trigger compile-time errors.
Explore arrays in C# by creating an object array, leveraging System.Object as the base type to hold mixed data, and using GetType to print each item's fully qualified type.
Explore rectangular and jagged multi-dimensional arrays in C#; learn how to declare, fill, and display rectangular arrays with equal row lengths and jagged arrays with varying inner array sizes.
Explore how to pass and return arrays, print array contents, and populate string arrays. Learn to use the system array class methods such as reverse and clear to manipulate arrays.
Explore the .NET type system, including classes, structures, enumerations, interfaces, and delegates, and learn how custom enums map symbolic names to values for foreach loops via I enumerable.
Set an enumeration's underlying storage type, such as byte instead of int, to save memory on low memory devices, and use enums to replace magic numbers with named values.
Explore structures as lightweight class types that encapsulate data, but cannot support inheritance like classes. When you need related types, use class types; we’ll inspect structures in Visual Studio.
Define a new structure named yardage with the struct keyword, expose two member variables and methods, and compare public versus private data accessed through properties in a structure-based sample.
Learn how to declare and initialize a struct variable with the new keyword, which calls the default constructor to auto-set fields and requires assigning all public fields before use.
Learn how a structure uses the new keyword and a custom constructor to assign values at creation, with an overloaded constructor demonstrating different initialization and incrementing fields.
Explore the distinction between a value type and a dot net reference type to deepen understanding of structures.
Examine value types versus reference types in C# by comparing a yardage struct and a yardage ref class, illustrating value copies on the stack and shared references in memory.
See how a value type struct containing a reference type behaves on assignment, illustrating shallow copies and how a clone interface enables deep copies.
Explore how reference types and value types are passed to methods in C#, compare passing by value versus by reference with a Person, and see how ref reassigns the object.
Compare value types and reference types by exploring allocation on the stack versus the heap, local copies versus memory references, and their parameter passing and lifetime semantics in c#.
Explore nullable types in C# by using the question mark syntax to represent underlying value types plus null, including HasValue and Value properties and database scenarios.
Explore nullable types in C# using the double question mark operator to assign defaults when values are null, offering a compact alternative to if-else.
Review core C# concepts: application type and main entry point, built-in types and keywords, System namespace, var usage, iteration and decision constructs, and methods with parameters and nullable types.
Test your knowledge of C# basics, including static main method requirements, access modifiers, console usage, and the distinction between value and reference types with dotnet type mappings.
Review your progress writing code in Visual Studio 2012 with C# and explore how C# relates to object-oriented programming.
Explore the core concepts of object-oriented programming and learn how they relate to C#, enabling you to leverage the power of the language for advanced features.
Explore C# class types and the object oriented programming triumvirate—encapsulation, inheritance, and polymorphism. See structured exception handling and interfaces in action, illustrated by city simulator and construction pricing software examples.
Learn how the class type, an object-oriented construct, combines fields and members: constructors, properties, methods, and events, to model real world entities and build a first class in Visual Studio.
Explore how a class type groups field data and members to model objects in C# and create a new class in Visual Studio as a base for room types.
Define a room class and explore its state by adding member variables such as descriptive name, maximum seating capacity, booked status, floor, and room number, then review an updated version.
Show how a public room class exposes state and behavior, including book, request services, and a diagnostic method, and how maximum occupancy changes reflect in the room state.
Learn how to allocate a room object in memory using the new keyword, avoid using unassigned variables, and use object initialization syntax to set properties efficiently.
Learn how constructors establish an object's state at creation by initializing fields, avoiding manual field-by-field assignments for many data points.
Learn how constructors initialize new objects with default values and how you can redefine the default constructor to set specific properties, like a room’s name, capacity, and type.
Explore how classes define additional constructors beyond the default to initialize an object's state at creation, and examine updating a room class to support three or more constructors.
Explore constructor overloading in c# by creating rooms with different parameters, and learn how defining custom constructors removes the default one unless explicitly added.
Learn how C# auto-generates a default constructor, how defining a custom one removes it, and how to reintroduce a default constructor with Visual Studio's code snippet.
Explore creating and managing constructors in a C# appointment class, including default constructors and multiple overloads using code snippets for quick setup.
Discover how the this keyword accesses the current class instance, resolves scope ambiguity when a parameter shares a field, and why C# case sensitivity and Intellisense support its use.
Explore the this keyword in constructor chaining to reduce redundancy across multiple constructors and centralize validation with a private static validate urgency method in the appointment class.
Learn to use the this keyword to chain constructors, designate a master constructor with validation, and forward arguments from secondary constructors, simplifying the appointment class maintenance.
Master constructor chaining in C# by using the this keyword to funnel calls to the master constructor, validate urgency, and reduce redundant code, with optional parameters offering similar benefits.
Observe how a constructor forwards data to a master constructor, executes business logic, and returns control to the originally invoked constructor, allowing additional startup logic to run.
Explore constructor chaining that works across any version of the Dot Net languages, and learn how optional named parameters in net Foro and higher simplify your programming tasks.
Learn how the static keyword moves members to class level and is invoked from the class name rather than an instance. See how utility classes expose static methods and data.
Compare instance level data with static data, showing each projector’s own date of service and usage while depreciation rate stays shared across all objects.
This lecture demonstrates static methods for a shared depreciation rate in a projector class, using get and set at the class level.
Decide which data should be static in a C# class, since static data is shared by all objects. Avoid referencing non-static members or using this in static members.
Explore how a typical constructor sets the value of an object's instance data at the time of creation, and how this setup prepares objects for use.
Explore how static constructors initialize static data in C#, ensuring values are set once before first use, even as new objects are created, and allow runtime values from external sources.
Static constructors run once per type, with no parameters or access modifiers, and are invoked before the first static member access or instance construction.
Learn how static classes function as utility classes, exposing methods at the class level without instantiation. The TimeDateUtilities example prints time and date, showing you cannot instantiate a static class.
Explore the three core principles, the OP triumvirate, that form the pillars of object oriented programming across languages such as C#, Java, and C++.
Explore the three pillars of object-oriented programming—encapsulation, inheritance, and polymorphism—and how abstraction helps model objects, with payroll examples showing data integrity, code reuse, and treating related objects similarly.
Encapsulation, pillar of object oriented programming, hides an object's data and restricts access to members, using private or protected state so outsiders must ask politely to change or obtain value.
Explore inheritance in object-oriented programming by building new class definitions from existing ones and extending base class behavior into derived or child classes.
Explore object-oriented inheritance where a conference room extends room to inherit core functionality and add its own details, and learn about has-a aggregation with bookings.
Explore polymorphism, the final pillar of O.P., showing how a base class defines a polymorphic interface with virtual or abstract members that derived classes can override or implement.
Learn how derived types override abstract methods from a base class and redefine responses to the same requests, illustrating polymorphism in C# .NET.
Explore how virtual and abstract members enable polymorphism across a room hierarchy, with conference room, hall, and banquet hall overriding the book method in a single array.
Explore encapsulation by examining how visibility affects classes, interfaces, and their members—properties, methods, constructors, and fields—using access modifiers to control what is visible.
Explore c# access modifiers—public, private, protected, internal—and default behaviors for type members and types. See how nested types use access levels and why non-nested types must be public or internal.
Implement encapsulation by keeping class data private and exposing it via public accessors or properties. Guard data against invalid values and enforce business rules, preventing overflow in room models.
Encapsulate data by using public getters and setters or public properties to hide internal details, enabling implementation changes without breaking existing code while validating constraints like maximum occupancy.
Explore how accessors and mutators protect internal data and how properties encapsulate getters and setters in C#. Learn why these patterns improve encapsulation and how to implement them.
Discover how accessors fetch private data and how mutators modify it through encapsulation using property syntax in C# to replace public fields.
Explore property syntax in C# that encapsulates getters and setters, showing how properties simplify using accessors and mutators and enable direct, intuitive assignments such as setting a room name.
Explore how set and get accessors validate input and enforce business rules by using the value token, constructors, and read-only and write-only properties to encapsulate data.
Explore formalizing static properties using C# property syntax by turning the projector's depreciation rate into a static property within the class.
Expose a private backing field for depreciation rate and implement a public static property with get and set, replacing mutator and accessor in the projector class.
Learn how automatic properties streamline encapsulation by replacing repetitive get and set boilerplate with simple property definitions, avoiding private backing fields when no business logic is needed.
learn how automatic properties in C# offload private field management to the compiler, simplifying room class properties and ensuring get and set accessors work without manual backing fields.
Explore automatic properties in C# .NET and how compiler uses backing fields with property syntax. See how room constructors initialize bookings and ensure objects come to life via property values.
Use c# automatic properties for simple encapsulation of a compiler generated private field. When a property requires data validation, logging, or database interaction, define a dot net property by hand.
Object initializer syntax enables creating a new object and assigning multiple public properties or fields in a few lines, serving as shorthand for a default constructor and property-by-property state setup.
Explore how C# object initialization syntax combines explicit default constructors with custom constructors, and how room and booking types compose to set current and all bookings at runtime.
Explore how const defines constant data in C# that cannot change after assignment, illustrated by a hall class with a 5000 seat limit.
Avoid duplicating code across related classes, like a dessert catering class matching catering’s members, and recognize that constructors in derived classes do not inherit from the parent.
Explore how inheritance preserves encapsulation in C#, comparing a dessert catering example that shows derived access to the base class members and the role of read-only properties and private members.
Explain why C# restricts each class to one direct base class, contrast with C++'s multiple inheritance, and show how interfaces can derive from multiple interfaces to model complex behaviors.
Use the sealed keyword to prevent inheritance by marking a class sealed, producing a compile-time error when attempting to derive from it; explore examples with the string type.
Explain that C# structs are implicitly sealed and cannot be derived from; use classes to express is-a relationships, while structs model standalone atomic data types.
We explore advanced inheritance concepts, noting that the colon operator establishes base derived class relationships and that the sealed keyword prevents further inheritance.
Learn how Visual Studio uses a class diagram to visualize base and derived class relationships, add and drag types from solution explorer into the class designer, and analyze generated code.
refactor the room class to broaden the class hierarchy and demonstrate inheritance in a new console project; copy and rename the reworked room internal and common files in studio.
Create a new C# project, organize rooms, service items, and bookers folders, import reworked room classes, adjust namespaces, and add a booking class to compile the inheritance-based class hierarchy.
Develop a class hierarchy for conference center rooms by extending a base room class into hall and banquet room, where banquet adds food options and hall omits them.
Extend the class hierarchy by adding public banquet room and hall derived from room, implement automatic properties for menu items and preregister, and verify inherited members and defaults through code.
Add a six-argument custom constructor to the banquet room, mapping name, menu items, room number, occupancy, and current booking to base class members. Address read-only fields and base constructor behavior.
Refine the class hierarchy by reducing reliance on public properties of the room base class to set states, addressing seven accesses—five inherited properties and two constructors—in the banquet room.
Learn to optimize derived class initialization by using the base keyword to call a base constructor in C# .NET, passing name, room number, floor, and occupancy to boost performance.
Use base keyword to access a parent class's public or protected members from a subclass, including beyond constructors, and remember that a custom constructor removes the default constructor, affecting polymorphism.
Define protected members in a base class to allow derived types to access data directly, but be mindful that direct access may bypass public business rules.
Identify protected members within a class hierarchy and define protected methods for derived types, noting that protected data appears private to the outside world and can affect encapsulation.
Discover how sealed classes prevent inheritance to protect utility classes and restrict specific branches in inheritance hierarchies, using the sealed keyword.
Explore the containment delegation model, aka aggregation, as a has-a relationship where a booking contains a booker. See how to model this in code using Visual Studio.
Introduce a public Booker class and embed it in the booking class as a public property, using a constructor to initialize a new Booker and demonstrate object containment.
Explore the containment and delegation model by exposing contained object functionality through public members, enabling booking to access a booker's properties via subclassing clerk, paralegal, attorney, and partner.
Learn to define a nested type inside a class in C#, treat it as a member, and control access with private modifiers while it can access the class's private members.
Explore how a nested type can declare member variables and how to qualify it from outside its containing type using the scope in Visual Studio.
Create a public office class with an inner public office type enum for headquarters, branch, satellite, and closed offices, plus name and location properties, illustrating deep nesting for type safety.
Explore how to build hierarchies of related types using containment, inheritance, and nested types. Then examine the final pillar of polymorphism.
Explore how polymorphism lets related types respond differently to the same request by overriding a public add hours of service method across laptops, projectors, screens, and catering services.
Explore polymorphism by overriding base class methods. Learn virtual and override keywords to extend or reuse default behavior with the base keyword.
Override virtual members in C# using the override keyword, aided by IntelliSense in Visual Studio to choose the correct base method and generate a base call override.
Explore how the sealed keyword prevents inheritance by stopping a class from extending behavior, and learn to prevent overrides of specific virtual methods within a class, demonstrated in Visual Studio.
Demonstrate sealing a virtual method in the catering class by using a sealed override for hours of service, preventing overrides in derived part-time caterer classes.
Design around abstract classes by ensuring the service item base provides common members and virtual methods that descendants can override, while preventing direct instantiation.
The lecture demonstrates how to implement an abstract base class in C# using the abstract keyword, update the service item class, and show why abstract classes cannot be instantiated directly.
Define an abstract base class with abstract members to enforce a polymorphic interface, and use a virtual book method overridden by hall and conference room subclasses.
Demonstrate abstract methods in a room hierarchy, requiring derived types to implement booking behavior and produce distinct outputs for large, small, and hall bookings.
explains how abstract methods define required names, return types, and parameters to form a polymorphic interface across derived room types, and how overrides prevent compiler errors.
Iterate over a room array that derives from the abstract base class, and invoke the same polymorphic interface method at runtime to keep code type-safe and extensible through derived classes.
Discover how a derived class shadows a base class member in C# by declaring an identical member, thereby masking the parent's version.
Explore how method shadowing occurs when subclassing external classes, especially from third-party packages. Learn best practices to manage risks in real-world C# .NET development.
Explore method shadowing in C# by deriving from a base hall class, then hide or override the inherited bookIt method using new and override keywords.
Explore method shadowing in C# by comparing overriding a base method with the override keyword when you can modify the base, versus handling unmodifiable base classes from third-party libraries.
Learn how the new keyword hides base class members in derived types, including fields, constants, and the Name property, and how an explicit cast can trigger the base implementation.
Explore class casting operations in C# .NET, using the is-a relationship for implicit upcasts from derived to base, and perform explicit downcasts to access specific derived types.
Explore the explicit downcast using the casting operator under the second law of casting, illustrated by casting a memory object to an updated conference room.
Explore how explicit casting runs at runtime, and how the as keyword safely checks type compatibility at runtime by returning null when incompatible.
Explore how a method accepting any type derived from ROOM uses the as keyword to access specialized members, and how the is keyword checks compatibility.
Use the is keyword and safe casting to handle room type 2 and its derivatives. Update the room name via change room name and prefix with S.R. for conference rooms.
illustrate how System.Object acts as the universal base class in dot net, show default object derivation, and demonstrate using ToString, GetHashCode, and GetType in a warrior dash example.
Override the ToString method to return a string that represents an object's current state, using semicolon-separated name-value pairs wrapped in square brackets for easier debugging, following dotnet conventions.
Override ToString to return the parent's string via the base keyword, then append derived class information like event name, location, and miles.
Override the equals method to support value-based semantics by comparing state values, such as event names, location, and miles, instead of reference equality.
Override equals by verifying the argument is a warrior dash object and comparing internal fields such as name and miles. Alternatively, use toString that represents the object's state for equality.
Override GetHashCode when you override Equals in C# .NET, because hash codes reflect object state and hash tables rely on GetHashCode and Equals for lookups.
Explore hash code algorithms and leverage the String.GetHashCode method, then override GetHashCode by using a unique field, such as an event id, to generate stable values.
Override GetHashCode by hashing the event id, or hash two strings if needed, as shown in the code.
Explore System.Object's static members that test for value-based or reference-based equality, and run code to see how equality is determined.
Demonstrates using System.Object's static methods Equals and ReferenceEquals to compare object state versus object identity, showing how two objects can share state but not reference.
Explore structured exception handling in C# with try, catch, and throw, distinguish app level from system level exceptions, and build custom exceptions while using Visual Studio debugging tools.
Explore how structured exception handling manages anomalies, contrasting it with traditional error handling, and review .NET exceptions such as null reference exception, file not found, and index out of range.
Explore the evolution from ad hoc error handling to structured exception handling in .NET, highlighting how custom error codes and return values gave way to standardized exceptions.
Demonstrate structured exception handling by packaging error information into a descriptive message, leverage Windows API error codes, and use COM interfaces like IErrorInfo and ICreateErrorInfo to return meaningful errors.
Explore how older structured exception handling techniques lack symmetry and are tailored to a specific technology, language, or project, highlighting limitations in cross-cutting error management.
Explore structured exception handling in the dot net platform, using try, catch, and throw to unify error handling across assemblies and languages, with exceptions as objects carrying descriptions and stacks.
Create a console app with a laptop and a processor to demonstrate structured exception handling when overclocking beyond the max clock speed, throwing and catching an exception with a try-catch.
Assess structured exception handling by deciding when to throw exceptions in an overclocking scenario, where a dead laptop processor triggers a system exception and recovery or clock reset may apply.
Use structured exception handling with a try-catch block to catch and inspect the exception object when invoking a method that may throw, then log details or report to administrators.
Learn structured exception handling by implementing try catch blocks, redefining and throwing custom exceptions, and testing multiple error paths to ensure the application continues after faults.
Examine the exception object's message and its additional members, such as target site, stack trace, help link, and data, and analyze these details case by case to qualify the problem.
Discover how the target site property reveals details about the exception-throwing method, using MethodBase to obtain the declaring type, fully qualified class name, and member type.
Understand how the stack trace identifies the sequence of calls leading to an exception, with the bottom line marking the first call and the top line identifying the offending member.
Attach a help link to exceptions to provide end users with detailed guidance. Initialize the help link before throwing the exception so users can access a website or help file.
Learn how the data property stores custom information in an exception, such as a time stamp, using a system.collections dictionary and iterating key-value pairs to reveal details.
Explore creating strongly typed exceptions in C# to represent runtime errors, learn why they capture details of the current problem, and review how to implement them in the studio.
Derive a public custom class from application exception, override the message and include a time stamp and reason via constructor, then throw and catch the processor is melted exception.
create custom exceptions when errors are tightly bound to the class issuing them, e.g., a file-centered class, a laptop class, or a data access object, enabling descriptive, error-by-error handling.
Explore creating custom exceptions by passing the incoming message to the base constructor instead of overriding the message property, and attach a cause via the inner exception.
Custom exception classes follow a simple pattern, serving as strongly named types that identify the nature of errors. It enables clients to provide different handler logic for different exception types.
Build a compliant custom exception by deriving from exception, marking serializable, and implementing constructors for default, message, inner exceptions, and serialization. Use Visual Studio's exception snippet to auto generate template.
Examine how a simple try block can lead to various exceptions and learn to implement multiple catch blocks to handle different error types in Visual Studio.
Explore how to throw and handle exceptions in C# by validating a boost value, using a try/catch structure, and raising an argument out of range exception with a custom message.
Explore how to arrange multiple catch blocks in C# so the first available catch handles exceptions. Prioritize the most specific exception types before the general System.Exception to avoid unreachable code.
Explore how the throw keyword rethrows exceptions from a catch block to the call stack, and why handling at the top level affects user experience and program stability.
Learn to use the throw keyword with no argument to rethrow the original exception, preserving its original information instead of creating a new exception object.
Demonstrate inner exceptions by handling one exception while recording a stack trace to a file with System.IO, and anticipate a file not found exception on the C drive.
Hover over a base class library member in Visual Studio to view possible exceptions. Identify exceptions like argument null and formatting for methods such as Console.WriteLine.
Learn how to pass an entire file-not-found exception via the constructor, throw it to the next caller, and handle the flow when no catch occurs.
Understand how interception lets the caller's catch logic extract details from the owner exception object, enabling graceful error handling.
The finally block within a try catch scope guarantees that a set of statements runs regardless of exceptions, enabling proper cleanup such as disposing objects, closing files, or detaching databases.
Identify unhandled exceptions in the .NET Framework by consulting the .NET Framework 4.5 SDK documentation to see which exceptions a base class library method may throw.
View the exceptions a base class library member may throw; hover over the right line method to see possible exceptions, including a formatting exception.
Explore how .NET differs from Java by not requiring handling of every exception, and learn how unhandled exceptions trigger debugger breaks and Visual Studio tools for debugging.
Explore interface based programming by defining and implementing interfaces, building types with behaviors, and examining interface references, implementation, and hierarchies in dotnet base class libraries for cloning, numeration, and sorting.
Define interfaces as a name and a set of abstract members that express a behavior a class or structure may support; in .NET, prefix interfaces with a capital letter.
Discover how interfaces enable multiple behaviors in C# .NET, with hundreds of predefined interface types from the base class libraries, implemented on custom classes to integrate with the framework.
Compare interface types with abstract base classes to see how interfaces define only abstract members and enable polymorphism across unrelated hierarchies, including the ICloneable interface and clone methods.
Compare abstract base classes and interface types, showing how interfaces like the I room interface let classes implement only the needed behavior, such as service items, without forced members.
Explore how interfaces define behavior and matter only when implemented by a class or struct, with conference and quiet rooms illustrating service items.
Explore how classes and structures implement interfaces in C# by listing base types and interfaces after colon, with System.Object as the base, and grasp the all-or-nothing commitment to interface members.
Use Visual Studio class diagrams and lollipop notation to identify interface implementations, noting when classes do not implement an interface and how to collapse interface names in the designer.
Interact with interface-driven functionality by invoking interface members directly from the object level when they are not implemented explicitly, then review a practical example in studio.
Explore how to determine if a type supports a specific interface using explicit casts and handling invalid cast exceptions, and discover the second way to check interfaces before invoking members.
Use the as and is keywords to determine interface compatibility in C#. Use as for safe casting, is for type checks, with a room array example in Visual Studio.
Explore how interfaces act as dot net types, passable as parameters and returnable as values, with a room example returning the first IRoom.
Learn how an interface can be implemented by diverse types and stored in an array, enabling iteration and treating each item as an interface-compatible object regardless of class hierarchy.
learn how to extract an interface from a class in Visual Studio, implement multiple interfaces with identical members, and access explicitly implemented members via casting.
Design interfaces in a hierarchy by extending existing interfaces to add abstract members, not implementations, and see derived interfaces like I advanced Booker require implementing inherited members.
Discover that a single interface can extend multiple base interfaces to create flexible abstractions, with ICaterer inheriting Booker and bad Booker, requiring three members or using explicit interface implementation.
Explore implementing dot net interfaces by examining the IEnumerable and IEnumerator interfaces. Learn that foreach can iterate over any type exposing a get enumerator method, not only arrays.
Explore how the inventory class supports foreach by implementing IEnumerable and IEnumerator, and learn to delegate enumeration to system array or use explicit interface implementation.
Learn how to use the yield keyword to create iterator methods that enable foreach iteration without implementing enumerable interfaces.
Explore how iterator methods use yield return to supply values to callers and enable foreach processing, while refactoring to align subcomponents and prevent out-of-sync changes.
Explore named iterators in C# by using the yield keyword in any method, accepting multiple arguments, and returning an enumerable interface to iterate sub items in order or in reverse.
Examine how named iterators empower custom containers by exposing multiple ways to request results via the enumerable interface, using yield return to implement named iterator methods.
Learn how System.Object defines the memberwise clone method to create a shallow copy, how protected calls support cloning, and how the ICloneable interface relates to this process.
Explore implementing the ICloneable interface to clone objects, demonstrating shallow copies for simple types and the need for new referent instances for true deep copies in a laptop example.
Examine deep copy through the ICloneable interface by inspecting a processor class that holds a reference type member and a friendly name, plus a global unique identifier.
Learn to implement cloning with reference types in a laptop class, distinguishing shallow copies from deep copies by creating a new processor and embedding it in the clone.
Explore the IComparable interface and how CompareTo enables type-safe sorting of custom objects. See a laptop example where the ID defines order and a sort produces an ordered set.
Explore implementing flexible sorting with IComparer in C# by creating helper classes to sort laptops by name or by ID, enabling multiple sort orders without altering the laptop type.
Explore implementing IComparer via a helper class inside the laptop type, then sort an array of laptops by id and by name alphabetically, using a static name comparer property.
Review how to define and implement your own interfaces and understand their usefulness across major dot net namespaces, as you continue exploring standard interfaces in the remainder of the course.
Examine the C-Sharp class type, constructors, and state initialization, including this, static, const, and readonly. Explore inheritance, polymorphism, interfaces, access modifiers, and structured exception handling with throw, catch, and finally.
Test structured exception handling in a C# .NET app by rethrowing the original exceptions with full stack traces and implementing logger-based logging and log file reading.
Explain why only one catch block executes in a single try, and summarize interface vs abstract class, and partial classes, along with keywords like virtual, override, abstract, sealed, and static.
Review the pillars of object oriented programming—encapsulation, inheritance, and interface-based programming—as we wrap this section. Delve into advanced C# concepts next to deepen understanding.
Introduce advanced features of C-sharp in part 1, building on earlier conversations and guiding your preparation for Microsoft 70-483.
Explore generics and collections with inherited interfaces, and master delegates, events, and lambda expressions. Learn about anonymous methods, operator overloading, and extension methods, plus object lifetime.
Develop and compare generics and collections in c# to store data from databases, files, web services using type-safe containers. Implement generic methods and types with where constraints in dotnet libraries.
Explore arrays as fixed-size containers for identically typed items, review system array behavior, and compare to dynamic containers that grow or shrink and enforce base class or interface constraints.
Explore generics and collection classes in the .NET base libraries, designed to resize dynamically, enhance type safety, and process data with memory-efficient, high-performance techniques.
Compare generics and non-generic collections across system namespaces. See how non-generic containers operate on object types, while generics use type parameters, marked with angle brackets, for stronger type safety.
Explore the System.Collections namespace and its non-generic collection classes, their core interfaces, and their relevance for legacy software maintenance in .NET.
Explore system.collections structures like stacks, queues, and lists, via an arraylist demo that resizes when items are added or removed and uses Count, Add, and AddRange, with generics highlighted.
Explore the System.Collections namespace, its non-generic and specialized collection types, and interfaces for custom collections; compare with generics and thread-safe collections in .NET libraries, and preview System.Collections.ObjectModel and System.Collections.Concurrent.
Analyze the drawbacks of non-generic collection classes and interfaces in .NET, including performance penalties from value types and lack of type safety, and learn how generics solve these issues.
Learn boxing and unboxing in C#, converting value types to and from object references, with heap allocation and safe unboxing, including invalid casts in non-generic ArrayList usage.
Demonstrates how a nongeneric array list stores value types as boxed objects, requiring casting to unbox on retrieval via the indexer, and explains boxing and unboxing in .NET.
Examine boxing and unboxing, stack-heap transfer, and their impact on speed and memory. See how generics enhance type safety and avoid boxing by using strongly typed containers.
Learn how generic collection classes reduce boxing and unboxing penalties and improve type safety. This reduces the need for custom generic collections by specifying the type and storing diverse objects.
Compare using generics to avoid boxing and unboxing for better performance and type safety, using a list of type T (player) and a stack-allocated type ENT of integers.
Explore how generic containers outperform non-generics by avoiding boxing and unboxing penalties, ensuring typesafe performance, and reducing the need for custom collection types in C#.
Explore how generics apply to classes, interfaces, structures, and delegates in .NET, note that enums cannot be generic, and see generic syntax in the Visual Studio object browser.
Learn how generics enforce type safety by using type parameters in collections like list<T> and dictionary<TKey, TValue>, with the compiler substituting T for your chosen type.
Explore how non-generic classes can host generic members, and how you specify the type parameter when invoking methods; compare non-generic static sort with its generic counterpart of type T.
Explore how generic interfaces like IComparable<T> and IEnumerable<T> improve code and enforce compile-time type safety, contrasting them with non-generic interfaces and previewing the System.Collections.Generic namespace.
Explore how the System.Collections.Generic namespace provides generic replacements for non-generic interfaces, enabling in-memory data management while preserving legacy functionality, as IEnumerable<T> extends IEnumerable.
Explore the system.collections.generic namespace, its core generic interfaces and classes, including linked list nodes and hash sets, and learn a C# feature introduced in dotnet 3.5 to populate collection containers.
Blend object and collection initialization to populate generic lists like List<Processor> with items in a single statement, using properties such as clock speed and description to create concise, readable code.
Explore the List<T> in the System.Collections.Generic namespace by initializing a list of players, inserting at a specific index, converting to an array, and iterating through the items.
Explore the generic stack in C#, learning push, pop, and peek to manage last-in, first-out data, with a practical example pushing and popping players.
Explore the queue of type T and implement first in, first out behavior by peeking, dequeuing, and processing players in a helmet assignment scenario.
Learn how a sorted set automatically maintains order by using a custom comparer, implementing IComparer<Player>, and inserting Homer, Marge, and Bart to verify correct sorting by number.
Explore the System.Collections.ObjectModel namespace, focusing on observable collection of type T that notifies external objects when its contents change, and its read-only counterpart for the presentation foundation.
Explore the observable collection of type T in the System.Collections.ObjectModel namespace, which mirrors list<T> for core interfaces but raises collection changed events on inserts, removals, relocations, or resets.
Demonstrates using the System.Collections.ObjectModel namespace to handle collection changed events with a delegate, examining old and new items and actions like add, remove, move, replace, and reset.
Explore how to build your own generic members and custom generic types beyond the base library, and implement custom generic methods for a supercharged version of method overloading.
Define a single generic swap method that swaps any two values of type T with type safety, preserving stack and heap semantics. This minimizes maintenance by consolidating overloads into one.
Master custom generic types by exploring when to infer or explicitly specify type parameters in generic methods, illustrated with a swap and a display base class example.
Explore constructing generic structures and classes in C# by building on generic methods, using identical processes, and opening a sample console project.
This lecture demonstrates converting a processor to a generic structure with a type parameter t, instantiating a processor of type t, and using default(t) to reset values.
Explore default values for generic type parameters, where numeric types default to zero and reference types default to null, and learn to use the default keyword to initialize T.
Learn to use the where keyword to constrain generic type parameters in C# for type-safe code, specifying structures, classes, new constraints, base classes, or interfaces.
Constrain a generic class to require a default constructor, enabling T to be instantiated and checked at compile time, and show how defining constructors affects the default constructor.
Apply where constraints to generic classes and methods, including a default constructor and the new constraint last, and learn why operator constraints are not supported—use an interface to simulate them.
Explore how delegates provide a typesafe callback mechanism, pointing to single or multiple methods for later invocation, enabling GUI controls to trigger external methods via multicasting and asynchronous invocation.
Explore how to create and manipulate delegate types, leverage the C# event keyword, and use anonymous methods, method group conversions, and lambda expressions for concise delegate handling.
Explore the evolution from C-style function pointers to .NET delegates, highlighting typesafe callbacks, parameter and return type handling, and common pitfalls in early Windows API designs.
Discover how the .NET delegate type enables type-safe callbacks by pointing to methods, which can be invoked later, and by capturing the method address, parameters, and return type.
Learn how .NET delegates point to static or instance methods and invoke them synchronously, enabling easy invocation on a secondary thread without manual thread management.
Define a delegate type with the delegate keyword and match its signature to method. The compiler creates a sealed class derived from System.MulticastDelegate enabling synchronous invoke and asynchronous begin invoke.
Understand how the C# delegate keyword creates a compiler-generated sealed class derived from system.multicastdelegate, enabling methods with out, ref, or array parameters and two-integer return signatures.
Examine the .NET delegate type by listing invocation targets, invoking their methods, and demonstrating static versus non-static behavior with a simple math class.
Use delegates to build a laptop class that informs external entities about its currently available memory state, demonstrating object state notifications with delegate types.
Define a laptop hard drive handler delegate to notify callers about hard drive state changes, register methods to the invocation list, and safely invoke them when memory usage changes.
Learn how to multicast with .NET delegates by using the plus equals operator to attach multiple methods to a single delegate, enabling multiple notifications about laptop hard drive status.
Learn to broadcast object state notifications with delegates, register multiple handler targets, and dynamically unregister them at runtime using the delegate invocation list and remove methods.
Use method group conversion to pass a method name instead of a delegate, simplifying calls that take delegates and streamlining registration with C# events for object state notifications.
Register and unregister from hard drive notifications using method group conversion, matching a delegate signature of void and string. The example highlights type safety and memory usage.
Expose generic delegate types in c#, create a void-returning delegate for a single parameter, and use a type parameter to handle varying arguments in a Visual Studio sample generic delegate.
Explore sending object state notifications using delegates by defining a generic delegate of type T and a target method that accepts a single string parameter.
Define a custom delegate that matches a method, instantiate it with a target method, and invoke it to enable callbacks; illustrate generic delegate of type T that may remain unused.
Learn to use the built-in action and function delegates for generic action<> and func<> delegates, deciding when a custom delegate is unnecessary and how to implement them in Visual Studio.
Explore the generic Action and Func delegates in C# .NET, using Action for methods with up to 16 parameters and void returns, and Func for return values.
Discover when to use action and function delegates versus custom delegates, their role as callbacks, and how they enable two-way communication, while highlighting encapsulation and common .NET API usage.
Examine how exposing a public delegate list breaks encapsulation, risking maintenance and security, and learn how private delegate members and the C# event keyword prevent unsafe invocation.
Explore how the event keyword automates registration and unregistration, and manages private delegate variables. See how these features help a custom class simplify sending notifications to external objects.
Define an event by creating a delegate named laptop hard drive handler, then declare fried and about to fry events using the event keyword. Check null before invoking delegates.
Explore how the event keyword in C# enables clean registration and detachment of event handlers using the += and -= operators, following a consistent pattern.
Master the event keyword usage in c# via method group conversion and plus-equals syntax, and see IntelliSense streamline event handler creation with default naming and accurate delegate signatures.
Explore the final enhancement to the laptop class by mirroring Microsoft's recommended event pattern, using a delegate's first parameter as System.Object and a custom EventArgs-derived class for data.
Explore the event keyword by wiring a laptop event arx with event args, passing this as sender, and using generic event handlers to streamline delegates.
Explore delegates and events in C#, wrap up with anonymous methods and lambda expressions to simplify callbacks across the language.
Explore using anonymous methods to handle events by attaching inline code to delegates with the plus-equals syntax, avoiding the need for named event handlers.
Explore how anonymous methods access the local variables of the defining method, and learn that these are called outer variables.
Describe how anonymous methods interact with the defining method's scope, including access to parameters, variable shadowing, and class member references, and how a handler increments a counter to tally events.
Examine C# lambda expressions and learn how to handle events inline by assigning code blocks to events with anonymous methods, a concise way to write anonymous methods that simplify delegates.
Explore the List<T>.FindAll method and how a predicate selects a subset, then compare traditional delegates, anonymous methods, and lambda expressions using an even-number example.
Define a lambda expression by specifying a parameter list, then use the => token (lambda operator) from lambda calculus. Follow with statements that process these arguments in C# .NET.
Explore lambda expression syntax, including parameter lists, modulo operations, and find all usage, with explicit or implicit type definitions and parentheses for consistency.
Explore how lambda expressions in C# can include multiple statement blocks to handle parameters across several lines, using curly brackets to scope these statements.
Explore lambda expressions in C# by examining lambdas with multiple parameters, type inference, delegates, and no-parameter forms, demonstrated through a simple math example.
Explore lambda expressions as anonymous methods to simplify working with delegates by revisiting the retrofitted laptop events project and opening laptop lambdas to examine the code.
Showcases a simplified Program class using lambda expressions to hook into laptop object events, replacing raw delegates, and demonstrates hooking into fry and fried methods to produce the same results.
Explore the role of lambda expressions in C#, enabling a functional approach to anonymous methods and delegates, and see how arguments are processed into statements, with a nod to LINQ.
Explore advanced C# features by implementing indexer methods for array-like access, overloading operators such as plus, minus, greater than, less than, and applying explicit and implicit conversions, extension methods.
Discover how to implement indexers in C# to let custom classes behave like arrays, using this, get scope, and collections such as lists and dictionaries.
Overload indexers in C# by defining multiple accessors for a single type, such as ordinal or string moniker in a dataset’s tables collection, which supports get and set operations.
Explore overloading indexer methods in .NET and show how a multi-dimensional indexer benefits a custom collection, with a data table of rows and columns.
Create an in-memory data table with three columns and a row, then use a multi-dimensional indexer to drill into each column, demonstrating overloading indexer methods.
Explore how the plus operator works across intrinsic C# data types, from integers to strings, and how the same symbol yields different results, like one plus one equals two.
Explore the plus operator's behavior with numbers and strings, including numeric addition and concatenation. See how C# allows custom classes to overload many operators, though not every operator is overloadable.
Explore overloading binary operators in c#, using a point class to implement plus and minus with static operator methods, and see how plus equals and minus equals are simulated.
This lecture explains overloading unary operators ++ and -- in C# using the static operator keyword and overloading equality and comparison operators with equals, !=, and the comparable interface.
Overload operators only when it makes sense for atomic data types; use points, rectangles, fractions, and hexagons as examples, and avoid overloading laptops or databases that confuse users.
Explore explicit and implicit conversions, including casts, show how upcasts and downcasts work in hierarchies, and create custom conversions with the parentheses casting operator for unrelated types and structures.
Explains custom type conversions in C# using static explicit and implicit operators, converting a rectangle to a square, and applying explicit casts to pass a rectangle to a square-parameter function.
Explore explicit conversions on a square type, converting rectangles to squares and casting between int and square, with the note that the compiler accepts any syntactically correct cast.
Learn to define implicit type conversions in C# alongside explicit ones, and apply the mixing rule on the same type, implicit rectangle conversion where width equals square’s side times two.
Overloaded operators act as shorthand for normal member functions and are optional when used correctly. Custom structures can be used more naturally as true class types related by inheritance.
Explore extension methods in .NET 3.5, which let you add new methods or properties to a class or structure without modifying the original type.
Explore how extension methods modify types without subclassing or direct edits, preserving backward compatibility while enabling new members on structures and sealed classes to behave polymorphically.
Define extension methods in a static class, using this on the first parameter to extend types, and use reflection to display the defining assembly or reverse digits for integers.
Define a class with extension methods in a namespace and import it with using to access them; extension methods are not global but limited to their defining or imported namespaces.
Discover how extension methods are discovered via namespaces and using directives. Isolate them in a dedicated .NET library to simplify imports and reduce confusion.
Explore how to extend any type that implements IEnumerable, including arrays and non-generic collections, using static extension methods. Learn about interfaces, generic constraints, and polymorphic use via interface extensions.
Discover how to create on-the-fly data types with var and object initialization, including private backing fields. Understand value-based equality, override ToString and GetHashCode, and use reflection to inspect anonymous types.
Explore how anonymous types use object initialization to create read-only properties, derive from System.Object, override Equals, GetHashCode, and ToString, and explain why operator== isn’t overloaded.
Examine how anonymous types compare with C# equality operators, testing references not values, and how identical anonymous types share a compiler generated class when properties color, make, and speed match.
Explore how anonymous types can compose other anonymous types to model a purchase order with timestamp, price, and car purchased, using object initialization syntax and naming properties on the fly.
Analyze the limitations of anonymous types, noting they should be used sparingly and mainly when using the link technology set, and advocate for preserving strongly typed classes and structures.
Explore the limitations of anonymous types, including uncontrollable names, System.Object inheritance, and read-only fields, plus lack of events, methods, or overrides, for modeling shapes in linked technologies.
Explore LINQ to objects and the LINQ programming model for querying data across arrays, in-memory collections, and relational databases using lambda expressions and anonymous types.
Explore LINQ to objects as a strongly typed query language embedded in C# with lambda expressions, object collection initialization syntax, and implicitly typed locals, usable across sql-like data stores.
Explore linq to objects for querying data across arrays and lists, applying criteria such as odd/even, primes, or numbers above 50, and retrieve metadata via reflection.
Explore LINQ to objects and how programmers access various data types through a diverse API, illustrated by a table of several common API patterns.
Explore how disparate data manipulation APIs operate as isolated islands and offer little integration, and see how LINQ to Objects addresses these asymmetries to streamline data handling.
Explore LINQ to objects, datasets, and entities with C#, using query expressions to manipulate data across sources, including parallel processing and strongly typed queries.
The Visual Studio project dialogue lets you choose the .NET version to compile against for .NET 3.5 or higher. Project templates reference the core LINQ assemblies in the solution explorer.
Explore the core LINQ assemblies and linking libraries, and ensure every C# file with LINQ queries includes the proper using directives to avoid compiler errors.
Learn to query an array of strings with LINQ using from, where, order by, and select to find items containing a space, store them in a subset, and print.
Discover how LINQ queries simplify extracting subsets of data from a source, and how implicit typing and the var keyword streamline capturing and iterating those results.
apply linq queries to primitive arrays by using the static system linq enumerable extension methods to operate on arrays via IEnumerable<T>, including aggregate, first, and max behind the scenes.
Apply linq queries to primitive arrays using extension methods, exploring how the dot operator reveals members beyond the system array definition.
Understand deferred execution in Linq: queries aren’t evaluated until iteration, allowing you to reuse the same query on a container and always retrieve the latest result set.
Discover how deferred execution in LINQ queries over primitive arrays yields updated subsets on each iteration. See how breakpoints in Visual Studio let you view the subset contents during debugging.
Explore how LINQ query operators operate on primitive arrays and non-generic containers by using IEnumerable of type T extension methods to extract data from array lists.
Learn how to store a LINQ query result in a field, the limits of using the VAR keyword for implicit typing, and how static scope affects returning results to callers.
Explain how LINQ query results can be strongly typed and returned as IEnumerable<string> or as a string array, using immediate execution to simplify callers.
Learn how query expressions and LINQ produce results and how to manipulate data within collections using generic types like a list of type T.
Learn to apply a LINQ query to a laptop list to filter results by processor speed greater than 2.6 and 2.7 for Alienware, and print laptop names.
Learn how LINQ query operators work with any IEnumerable<T>, directly or via extensions. See how to iterate non-generic collections like ArrayList by specifying the item type to get an IEnumerable<T>.
Demonstrates filling an array list with laptop objects and using a Linq query to display fast laptops with a 2.7 threshold, yielding work laptop and Steelers laptop.
Explore how non-generic containers hold mixed items and how to filter a subset to numerical data using OfType<T>() in a linq query.
This lecture demonstrates using a LINQ query to filter a mixed type collection by type, returning only integers from an array list.
Explore how LINQ queries extend to arrays, generic and non-generic collections, handling integers, strings, and custom classes, and learn about additional link operators to build more complex, useful queries.
Explore C# LINQ query operators and extension methods on enumerable collections, including distinct, union, intersect, count, sum, min, max, and conversions like to array and to list, with sample data.
Learn that the syntax of a query expression is validated at compile time and that the order of the from, in, and select operators is critical.
Master the basic linq query template with from and in, query a data container like products, and contrast selecting all items with selecting only names (p in products select p.name).
Learn how to obtain a specific subset from a container using the where operator, where the operator expects a boolean expression and the general template is shown.
Explore how to use where clauses and anonymous types in LINQ to filter and project product data, returning name and description for overstocked or in-stock items.
Discover how to use LINQ queries with projection and anonymous types, where the var keyword is mandatory, and how to return a subset of anonymous types to callers.
Transform the query result into a System.Array using the array extension method, returning anonymous types as a literal array when the underlying type is unknown at compile time.
Explore how projection operations transform data and why you lose strong typing with object arrays, then learn to count returned items using the enumerable count extension method.
Filter videogames with a where clause for length greater than six, count results to four, then reverse the sequence using the enumerable reverse extension to display items in reverse order.
Sort items in a subset by a specific value with the order by operator, defaulting to ascending order; use the descending operator for reverse results.
Sort by name with order by to show ascending or descending results. Use extension methods like except, intersect, union, and concat to compare and combine data.
Explore how the concat extension can produce duplicate entries and learn to remove duplicates with the distinct extension method, understanding when to apply it to clean data.
Explore distinct values from concatenated car subsets and perform aggregations with max, min, average, and sum to illustrate Linq query operators.
See how C# LINQ query operators are translated by the compiler into calls on the enumerable class, via extension methods and the underlying object model, using generic delegates named function.
Explore how the enumerable where LINQ query operator works, including overloads and the function delegate concept. Inspect Visual Studio's Object Browser to see the various function forms.
Explore how delegates, anonymous methods, and lambda expressions serve as input, compare manual delegate types with LINQ query operators, and reveal their underlying connection to enumerable types.
Learn how to build Linq queries in C# using query operators and lambda-based extensions like where, orderby, and select on a videogames dataset, demonstrating both approaches.
Explore the internal representation of linq queries by comparing verbose enumerable methods with the concise c# query operators, aided by lambda expressions and delegates. See the studio demonstration.
Explore how LINQ query expressions are represented under the covers, comparing anonymous methods, lambdas, and direct delegates, and showing a complex query expression class embodying the same operations.
Understand how C# query operators translate to extension methods for enumerable types, using delegates and lambda expressions to improve readability and reveal their behind-the-scenes behavior.
Learn how C# manages object lifetime via the garbage collector and managed heap, with no delete keyword, and explore the finalize method, the disposable interface, and lazy System.Lazy features.
Explore how classes define blueprints for objects, how new returns a reference to heap-allocated objects, and how dot notation accesses members from a laptop class example.
Explore the class-object-reference relationship, distinguishing value types (structures on the stack) from heap-allocated class instances, and understand how the CLR and garbage collector manage memory with new allocations.
Discover how the garbage collector determines when an object is no longer needed: it removes objects from the heap only if they are unreachable by any part of your codebase.
Demonstrate how a locally allocated laptop object is created inside a method, remains reachable only within that scope, and becomes eligible for garbage collection once the method finishes.
Discover how a garbage collected environment, powered by the garbage collector, simplifies application development by automatically destroying objects, reducing memory leaks and the manual burden of memory management.
The lecture explains how the C# compiler uses the new keyword to emit new object instructions in a method, and how assembly reveals object creation in the managed heap.
Understand how the managed heap allocates new objects with the next object pointer, verifies space, calls constructors, returns references, advances the pointer, and triggers garbage collection when memory runs short.
Explore how garbage collection differs across dotnet platform versions and why this matters for dotnet applications.
Explore how setting an object reference to null in C# disconnects the reference from the object without triggering garbage collection, contrasting with C and C++ practices.
Learn how the garbage collector uses roots to decide when to collect, and how object graphs document reachable objects on the managed heap.
Explore how an object graph is analyzed during garbage collection, marking active roots and sweeping unreachable objects from the managed heap, followed by memory compaction and pointer readjustment.
Examine how the garbage collector uses two distinct regions, including a large-object heap, and why the managed heap is treated as a single memory region.
Explore how the garbage collector uses generations to locate unreachable objects efficiently. Learn how generation 0, 1, and 2 objects are promoted, with ephemeral generations shaping collection.
Explore the System.GC type and concurrent and background garbage collection in .NET, focusing on generation 0/1 cleanup, thread suspension, and performance improvements for real-time apps.
Explore the System.GC type in the dotnet framework, learn how to interact with the garbage collector via static members, and examine methods like GetTotalMemory and MaxGeneration.
Learn how the .NET garbage collector manages memory and how to explicitly trigger GC.Collect, including generation 0 targeting and default or forced modes, while avoiding waiting for pending finalizers.
Explore how System.Object's protected finalizer is invoked by the garbage collector for cleanup, why most classes need none, and when to implement the disposable interface for unmanaged resources.
Learn how to override the finalizer in C# to free unmanaged resources using p/invoke or com interop, employing a C++-like destructor syntax and a single implicitly protected finalizer.
Explore how finalizable objects manage unmanaged resources, why finalization is non-deterministic and slow, and how to prefer implementing the disposable interface with a dispose method for deterministic cleanup.
Explore implementing the IDisposable interface in C# to manage resources and compare finalize with dispose, then use the using statement to auto-call Dispose.
Explore how to blend finalizers and the disposable pattern in a single class to reliably clean up unmanaged resources, using dispose and suppress finalization to optimize garbage collection.
Shows how to finalize a disposable resource wrapper in C#, updating the dispose method to call GC.SuppressFinalize after freeing unmanaged resources.
Master the official dispose pattern for a C# resource wrapper: reduce duplicate finalize and dispose code, safeguard multiple calls, and correctly manage managed versus unmanaged resources for robustness and maintainability.
Master the disposable wrapper pattern by handling user-initiated versus garbage-collection cleanup, using a disposed flag and finalizer suppression to manage both managed and unmanaged resources.
Use lazy initialization to defer creating heavy data, such as the all tracks list, until get all tracks is called, reducing memory usage and GC pressure.
Learn how lazy instantiation defers loading tracks until you call get all tracks, using a Func delegate or lambda expressions to create expensive objects on demand.
Review of non-generic vs generic collections, generics with constraints, delegates and events, anonymous methods and lambdas, extension methods, LINQ, garbage collection, finalization, disposing, and lazy initialization.
Advance through the heavy topics we've covered. Prepare for conversations on building class libraries, type reflection dynamics, and multi-threading in the next sessions.
Explore the base class libraries and the various parts of the .NET namespaces to build a solid foundation in programming with .NET.
Explore building class libraries to reuse classes across apps, cover type reflection, late binding, and dynamic libraries, then tackle multi-threading, asynchronous programming, and data access.
The Programming C# course provides full coverage of the programming skills required to create Windows applications using C#. This new and exciting course also provides knowledge on language syntax, C# program structure and implementation details.
This new course provides you the needed training for building new data types, handling events, accessing a database, using remote data, integrating with unmanaged code, as well as the knowledge and skills to perform operations asyncrhonously, creating custom attributes and more.
This course brings together all the features of programming in C# using Visual Studio.
Some of the skills you will learn in this class are:
Describe the core syntax and features of C#
Implement the basic structure and essential elements of a typical desktop application
Encrypt and decrypt data by using symmetric and asymmetric encryption
Examine the metadata of types by using reflection, create and use custom attributes, generate code at runtime and manage assembly versions
Integrate unmanaged libraries and dynamic components into a C# application
Improve the throughput and response time of applications by using tasks and asynchronous operations
Build a graphical user interface by using XAML
Use the types in the System.Net namespace and WCF Data Services to access and query remote data
Create and use an entity data model for accessing a database and use LINQ to query and update data
Read and write data by using file input/output and streams and serialize/deserialize data in different formats
Use inheritance to create a class hierarchy, extend a .NET Framework class and create generic classes and methods
Create classes, define and implement interfaces and create and use generic collections
Create and call methods, catch/handle exceptions and describe the monitoring requirements of large applications