Programming C# 6, Part 10 of 12: Classes and Methods
Interactive

Programming C# 6, Part 10 of 12: Classes and Methods

LearnNow Online
Updated Aug 22, 2018

Course description

In this course, Visual Studio expert Don Kiely teaches you the techniques needed to build sophisticated classes in your code. Using a sample customer class, he will demonstrate how to validate property values and also explore automatic properties as well as advanced method techniques such as parameter arrays.

Each LearnNowOnline training course is made up of Modules (typically an hour in length). Within each module there are Topics (typically 15-30 minutes each) and Subtopics (typically 2-5 minutes each). There is a Post Exam for each Module that must be passed with a score of 70% or higher to successfully and fully complete the course.


Prerequisites

This course builds upon: Programming C# 6: Getting started Programming C# 6: Your First App Programming C# 6: Projects and Syntax Programming C# 6: Variables and Data Types Programming C# 6: Adv Data Types and Operators Programming C# 6: Strings, File I/O and Date Types Programming C# 6: Conditions and Looping Programming C# 6: Objects and Classes It is considered a more Intermediate to advanced topic after you have gone through these other courses.


Meet the expert

Don Kiely

Don Kiely is a featured instructor on many of our SQL Server and Visual Studio courses. He is a nationally recognized author, instructor, and consultant specializing in Microsoft technologies. Don has many years of teaching experience, is the author or co-author of several programming books, and has spoken at many industry conferences and user groups. In addition, Don is a consultant for a variety of companies that develop distributed applications for public and private organizations.

Video Runtime

146 Minutes

Time to complete

551 Minutes

Course Outline

Methods

Properties (27:58)

  • Introduction (01:26)
  • Sample Customer Class (02:07)
  • Demo: Class Properties (05:17)
  • Demo: Write & Read Properties (05:11)
  • Demo: Location Property (03:52)
  • Demo: Calculated Property Value (01:44)
  • Demo: Annual Sales Property (03:11)
  • Demo: Changing Values (04:38)
  • Summary (00:27)

Automatic Properties (19:28)

  • Introduction (00:29)
  • Demo: Automatic Properties (04:28)
  • Demo: Backing Fields (04:12)
  • Demo: Intitializers (02:55)
  • Getter-Only Auto-Properties (01:40)
  • Demo: Read-Only Auto-Property (05:11)
  • Summary (00:30)

Methods (15:15)

  • Introduction (00:46)
  • Methods (01:01)
  • Parameters and Return Values (02:11)
  • Passing Arguments to Methods (01:17)
  • Demo: Pass Parameters (03:19)
  • Demo: Pass by Reference (02:02)
  • Demo: Pass with Out (04:06)
  • Summary (00:30)

Optional Param and Caller Info (17:25)

  • Introduction (00:33)
  • Demo: Flexible Parameters (05:14)
  • Demo: Named Parameters (04:34)
  • Caller Information Attributes (00:57)
  • Demo: Caller Info Attributes (05:38)
  • Summary (00:26)
Methods in Classes

Methods in Classes (12:08)

  • Introduction (00:35)
  • Methods in Classes (04:24)
  • Class Constructors (01:49)
  • Demo: Constructors (04:43)
  • Summary (00:36)

Save and Retrieve Info (18:42)

  • Introduction (00:32)
  • Demo: XMLWriter (05:29)
  • Demo: SaveCustomer (05:07)
  • Demo: GetCustomerInfo (03:27)
  • Demo: GetLocation (03:36)
  • Summary (00:27)

Return and Pass Arrays (11:44)

  • Introduction (00:52)
  • Demo: Parameter Array (03:44)
  • Demo: Variable-Length Array (04:36)
  • Demo: Pass Parameter Array (02:00)
  • Summary (00:31)

Instance and Static Members (10:54)

  • Introduction (00:34)
  • Demo: Static Variables (01:56)
  • Demo: RecordSales (04:24)
  • Demo: GetCustomerName (03:13)
  • Summary (00:45)

Expression Bodied Methods (12:25)

  • Introduction (00:39)
  • Lambda Expressions (01:26)
  • Demo: Expression-Bodied Method (03:31)
  • Demo: Refinements (03:52)
  • Demo: Using Lambda Expressions (02:22)
  • Summary (00:33)
;