Call Us: +32 2 466 00 16
Email: info@u2u.be
Follow Us:

Object Oriented Programming in C#

3 days
uec1
3 days

Upcoming Sessions

Date: currently not scheduled

Format: Classroom

Price: 0€


Date: currently not scheduled

Format: Remote Classroom

Price: 0€


Subscribe to waiting list

Date: currently not scheduled

Format: Classroom

Price: 0€


Date: currently not scheduled

Format: Remote Classroom

Price: 0€


Subscribe to waiting list

Interested in a private company training? Request it here.

Overview of .NET

.NET is designed to be used for developing multiple types of applications. You'll get an overview of the applications you can build. You will also be introduced to the different flavors contained within .NET Framework and .NET.

  • What is a .NET Application?
  • .NET Framework versus .NET
  • .NET Applications: ASP.NET Core, Web API, WPF, Blazor, MAUI, ...

The .NET Application

When building applications in .NET, it needs to follow a couple of rules. We'll look at the structure of an application and which parts are necessary during runtime.

  • The Visual Studio Solution and Project
  • What are Namespaces and Assemblies

Classes and Objects

One of the most basic parts of Object-Oriented (OO) programming is designing a blueprint (called class) and during runtime creating an object out of that. In this module, we will talk about the real fundamentals of .NET programming. We create variables to store numbers, text and complex objects and try to use operators on them. We'll explore the ways in which you create a class, and add state and behavior to objects. This chapter also gives an introduction to debugging using Visual Studio.

  • What is a Class?
  • Fields, Methods and Properties
  • Introduction to Debugging
  • Namespaces
  • LAB: Work with Classes, Class Members and Instances

Instance Constructors

Whenever you instantiate an object from a class, it needs to be constructed. This module will discuss how .NET handles this.

  • Instance Constructors
  • Constructor Initializers
  • Overloading Constructors
  • LAB: Work with Constructors and Object Initializers

Types in .NET

Whether you're trying to store numbers, text or objects, you need to put them into variables. These variables will inevitably end up somewhere in memory. By knowing where in memory each type of variable gets stored, we can predict what will happen to them.

  • Type Categories in .NET
  • Value Types, Reference Types and Immutable Reference Types
  • Custom Value Types: Structure and Enumeration
  • Boxing and Unboxing
  • Type Inference
  • Arguments of Functions. Pass by Value, by Reference. Passing Output
  • LAB: Enums, Pass by Reference, Structs and StringBuilder

Static Members and Static Classes

From time to time, you need some functionality that is not part of one object, but instead part of a complete class. This allows you to use methods without creating an object, or storing data that is reachable for every object. In .NET we call this static members and classes.

  • Static Members
  • Static Constructors
  • Static Classes
  • Extension Methods
  • LAB: Car Factory

Inheritance

A very important aspect of OO programming is being able to inherit functionality from a basic concept. We'll explore how we can use Inheritance to extend a class and add functionality to it. To help you a bit with a practical example we'll create an ASP.NET Core MVC application to illustrate Inheritance.

  • General Principle of Inheritance
  • Access Modifiers: Public, Private, Protected, File and Internal
  • LAB: Creating a Web Shop in ASP.NET Core

Polymorphism

On top of Inheritance in OO programming comes this marvel called polymorphism. It allows us to add a different implementation for specific types, based on a generic definition of a function. With polymorphism this is an easy feat to accomplish.

  • Inheritance & Polymorphism
  • Overriding Methods & Properties
  • Using the Base Class
  • Sealed Classes, Methods and Properties
  • The Object Class
  • Overriding the ToString, Equals and GetHashCode Method
  • LAB: Adding Polymorphism to an Employee Class

Abstract classes and Interfaces

Both concepts are incredibly important in .NET. We'll have a look at how to implement this with an ASP.NET Core MVC application.

  • Abstract Classes
  • Defining Interfaces
  • Implementing Interfaces
  • Interface Examples in .NET
  • LAB: Implementing IComparable and Controlling Devices

Collections

Storing elements in a collection is crucial in programming languages. This chapter talks about one of the most basic collections in .NET.

  • Arrays in .NET
  • Multidimensional Arrays
  • Indexer Properties
  • The for, foreach and while Loops

Generics

In C#, you can consider two separate mechanisms when writing reusable code across different types: inheritance and generics. Where inheritance provides reusability with the concept of base types, generics express reusability by providing a template that contains type placeholders. Generics, in comparison to inheritance, can increase type safety and reduce the need for casting and boxing within your applications. This module will illustrate how and when to use generics in your .NET applications. We'll use a WPF application to illustrate Generics.

  • How to use Generics
  • Creating your own Generics
  • Generic Constraints
  • LAB: Sports Team or Movietheek

Exception Handling

Whenever something unexpected happens, like the network going down, we want our programs to handle this behavior in a user-friendly way. With Exceptions we can react fittingly when these problems occur.

  • Exceptions in .NET
  • The try-catch-when-finally Keywords
  • Creating Custom Exceptions

Using Delegates

One of the more challenging aspects of .NET programming is to be able to store methods in a variable. That is exactly what delegates allow us to do. This concept is used with a lot of .NET concepts, like asynchronous programming, event handling, LINQ, ...

  • Setting up a Timer using a delegate
  • Combining Delegates as a Multicast Delegate
  • Building a Programmable Robot using Delegates
  • Anonymous Methods and Lambda Expressions
  • LAB: Calculator

Events in .NET

Events are based on delegates, allowing your application to react to something happening, like a button click.

  • Creating Events
  • Using Events in a UI
  • LAB: Music Store

The Async and Await Syntax Explained

The async and await keywords are amongst the most commonly used language constructs in .NET. But surprisingly few people know how it actually works.

  • What is Asynchronous Programming?
  • Comparing async/await to other Asynchronous Constructs
  • Diving into the Keywords
  • Async Guidelines
  • LAB: using Async and Await

LINQ Query Syntax

LINQ allows to use query-expressions that are very akin to SQL queries, but that can be applied to multiple types of data. This makes certain operations like filtering and sorting data very easy.

  • Anonymous Types
  • Using LINQ with IEnumerable
  • Func Delegates
  • Query Operations from, where, order, group and select
  • Using LINQ with IQueryable
  • Accessing a Database using Entity Framework Core
  • LAB: Creating a Shop in WPF

This course teaches you how to start programming with Visual Studio, C# and .NET. You will get familiar with the C# language syntax and the .NET Object-Oriented concepts, such as classes, objects, inheritance, polymorphism, ... In this course, you'll get a taste of the different types of applications and .NET libraries through examples in WPF, Entity Framework Core and ASP.NET Core.

This training targets developers with no or limited C# experience. A basic understanding of programming - in whatever language - is advised. Once you've finished this training, you can start your journey to learn building things like web applications, desktop or mobile apps, backends, games, IoT, bots, etc. All with C#.

Contact Us
  • Address:
    U2U nv/sa
    Z.1. Researchpark 110
    1731 Zellik (Brussels)
    BELGIUM
  • Phone: +32 2 466 00 16
  • Email: info@u2u.be
  • Monday - Friday: 9:00 - 17:00
    Saturday - Sunday: Closed
Say Hi
© 2024 U2U All rights reserved.