Skip to content

Commit a0993b3

Browse files
Merge pull request #49802 from wwlpublish/882fb6eb904537ee56fa040133256c81cb1967f9cd5ae798fd376de9b62a7fff-live
Modules/M03-implement-enum-struct-record-types
2 parents bd0a1db + 5a19b92 commit a0993b3

9 files changed

+9
-32
lines changed

learn-pr/wwl-azure/implement-enum-struct-record-types/1-introduction.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Introduction
44
metadata:
55
title: Introduction
66
description: "Introduction to the module."
7-
ms.date: 03/31/2025
7+
ms.date: 04/01/2025
88
author: wwlpublish
99
ms.author: eric
1010
ms.topic: unit

learn-pr/wwl-azure/implement-enum-struct-record-types/2-use-enums-represent-named-constants-csharp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Use enums to represent named constants in C#
44
metadata:
55
title: Use enums to represent named constants in C#
66
description: "Learn how to use enums in C# to define named constants and improve code readability."
7-
ms.date: 03/31/2025
7+
ms.date: 04/01/2025
88
author: wwlpublish
99
ms.author: eric
1010
ms.topic: unit

learn-pr/wwl-azure/implement-enum-struct-record-types/3-create-structs-encapsulate-data-csharp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Create encapsulated data with structs in C#
44
metadata:
55
title: Create encapsulated data with structs in C#
66
description: "Learn how to use structs in C# to group related data into lightweight, efficient containers."
7-
ms.date: 03/31/2025
7+
ms.date: 04/01/2025
88
author: wwlpublish
99
ms.author: eric
1010
ms.topic: unit

learn-pr/wwl-azure/implement-enum-struct-record-types/4-apply-records-immutable-data-models-csharp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Apply records for immutable data models in C#
44
metadata:
55
title: Apply records for immutable data models in C#
66
description: "Learn how to use records in C# to create immutable data models with value-based equality."
7-
ms.date: 03/31/2025
7+
ms.date: 04/01/2025
88
author: wwlpublish
99
ms.author: eric
1010
ms.topic: unit

learn-pr/wwl-azure/implement-enum-struct-record-types/5-exercise-implement-enum-struct-record-types.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Exercise - Implement enum, struct, and record types
44
metadata:
55
title: Exercise - Implement enum, struct, and record types
66
description: "Practice implementing enums, structs, and records in C# to reinforce your understanding of these concepts."
7-
ms.date: 03/31/2025
7+
ms.date: 04/01/2025
88
author: wwlpublish
99
ms.author: eric
1010
ms.topic: unit

learn-pr/wwl-azure/implement-enum-struct-record-types/6-knowledge-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Knowledge check
44
metadata:
55
title: Knowledge check
66
description: "Check what you've learned in this module."
7-
ms.date: 03/31/2025
7+
ms.date: 04/01/2025
88
author: wwlpublish
99
ms.author: eric
1010
ms.topic: unit

learn-pr/wwl-azure/implement-enum-struct-record-types/7-summary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Summary
44
metadata:
55
title: Summary
66
description: "Summarize the key concepts covered in this module."
7-
ms.date: 03/31/2025
7+
ms.date: 04/01/2025
88
author: wwlpublish
99
ms.author: eric
1010
ms.topic: unit

learn-pr/wwl-azure/implement-enum-struct-record-types/includes/2-use-enums-represent-named-constants-csharp.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -154,27 +154,4 @@ order.UpdateStatus(OrderStatus.Shipped);
154154

155155
This example demonstrates how to define an enum for order statuses, use it in a class, and update the status of an order. It helps beginners see how enums can be applied in a real-world scenario.
156156

157-
## Use object initializers with structs
158-
159-
Define a struct with properties to group related data together and make it easier to initialize and work with instances of the struct.
160-
161-
```csharp
162-
public struct Point
163-
{
164-
public int X { get; set; }
165-
public int Y { get; set; }
166-
}
167-
```
168-
169-
Using an object initializer, you can create and initialize a `Point` instance like this:
170-
171-
```csharp
172-
var point = new Point { X = 10, Y = 20 };
173-
```
174-
175-
*Code sample demonstrates how to use an object initializer to set property values when creating a struct instance.*
176-
177-
> [!NOTE]
178-
> Object initializers make your code more concise and easier to read, especially when working with structs that have multiple properties.
179-
180-
Enums in C# simplify code by allowing you to define a set of named constants, making it easier to represent and manage fixed values like statuses or categories while improving readability and maintainability.
157+
By using enums, you can replace numeric literals with meaningful names, making your code more intuitive and easier to maintain, while also enabling explicit conversions and validations to ensure safe usage of these constants in your projects.

learn-pr/wwl-azure/implement-enum-struct-record-types/index.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uid: learn.wwl.implement-enum-struct-record-types
33
metadata:
44
title: Implement Enum, Struct, and Record Types
55
description: "Learn to create organized, maintainable code with enum, struct, and record types in C#."
6-
ms.date: 03/31/2025
6+
ms.date: 04/01/2025
77
author: wwlpublish
88
ms.author: eric
99
ms.topic: module

0 commit comments

Comments
 (0)