Skip to content

Commit e89dee7

Browse files
authored
changed files by pdets auto publish service, publishid[d6962429-c76c-4b62-a8c0-f1c2fe4796b7] and do [publish].
1 parent 1a41b66 commit e89dee7

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

learn-pr/wwl-azure/get-started-generic-anonymous-types/2-examine-generics.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### YamlMime:ModuleUnit
22
uid: learn.wwl.get-started-generic-anonymous-types.examine-generics
3-
title: Examine Generics
3+
title: Examine generics
44
metadata:
5-
title: Examine Generics
5+
title: Examine generics
66
description: "Learn how generics acts as code templates that allow you to define type-safe data structures without committing to an actual data type."
77
ms.date: 03/31/2025
88
author: wwlpublish

learn-pr/wwl-azure/get-started-generic-anonymous-types/3-explore-advanced-generics-concepts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
### YamlMime:ModuleUnit
22
uid: learn.wwl.get-started-generic-anonymous-types.explore-advanced-generics-concepts
3-
title: Explore advanced Generics concepts
3+
title: Explore advanced generics concepts
44
metadata:
5-
title: Explore advanced Generics concepts
5+
title: Explore advanced generics concepts
66
description: "Understand advanced concepts of generics, including covariance, contravariance, and generic constraints, to write more flexible, and reusable code."
77
ms.date: 03/31/2025
88
author: wwlpublish

learn-pr/wwl-azure/get-started-generic-anonymous-types/6-knowledge-check.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@ quiz:
1818
choices:
1919
- content: "To allow code to handle multiple data types while ensuring type safety."
2020
isCorrect: true
21-
explanation: "Correct. Generics enable developers to write reusable code that works with different data types, ensuring type safety by catching errors at compile time."
21+
explanation: "Correct. Generics enables developers to write reusable code that works with different data types, ensuring type safety by catching errors at compile time."
2222
- content: "To improve runtime performance by optimizing memory usage."
2323
isCorrect: false
2424
explanation: "Incorrect. While generics can enhance performance by avoiding unnecessary type conversions, their primary purpose is to ensure type safety and code reusability."
2525
- content: "To simplify debugging by automatically generating error messages."
2626
isCorrect: false
27-
explanation: "Incorrect. Generics do not generate error messages for debugging; they ensure type safety during compilation, reducing runtime errors."
27+
explanation: "Incorrect. Generics does not generate error messages for debugging; they ensure type safety during compilation, reducing runtime errors."
2828
- content: "Which of the following is an example of a generic class?"
2929
choices:
3030
- content: "`public class Box<T> { public T Item { get; set; } }`"
3131
isCorrect: true
3232
explanation: "Correct. This is a generic class where 'T' acts as a placeholder for the type, allowing the class to work with any data type."
3333
- content: "`public class Box { public int Item { get; set; } }`"
3434
isCorrect: false
35-
explanation: "Incorrect. This is a non-generic class because it is explicitly defined to work only with integers."
35+
explanation: "Incorrect. This is a non-generic class because it's explicitly defined to work only with integers."
3636
- content: "`public class Box { public void AddItem(string item) { } }`"
3737
isCorrect: false
38-
explanation: "Incorrect. This is a non-generic class because it is designed to work only with strings, not multiple data types."
38+
explanation: "Incorrect. This is a non-generic class because it's designed to work only with strings, not multiple data types."
3939
- content: "Which of the following scenarios is a common use case for anonymous types in C#?"
4040
choices:
4141
- content: "Projecting selected properties in a Language-Integrated Query (LINQ)."
4242
isCorrect: true
4343
explanation: "Correct. Anonymous types are commonly used in LINQ queries to project results into objects with only the required properties."
4444
- content: "Defining a reusable class for multiple methods."
4545
isCorrect: false
46-
explanation: "Incorrect. Anonymous types are not reusable and are intended for temporary use within a single method."
46+
explanation: "Incorrect. Anonymous types aren't reusable and are intended for temporary use within a single method."
4747
- content: "Creating mutable objects for data manipulation."
4848
isCorrect: false
49-
explanation: "Incorrect. Anonymous types are immutable, meaning their properties are read-only and cannot be modified after creation."
49+
explanation: "Incorrect. Anonymous types are immutable, meaning their properties are read-only and can't be modified after creation."

learn-pr/wwl-azure/get-started-generic-anonymous-types/includes/3-explore-advanced-generics-concepts.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Advanced use of generics builds on the foundation of generics by introducing fea
1515
> [!TIP]
1616
> Use advanced generics to simplify complex scenarios while keeping your code reusable and type-safe.
1717
18-
## Generic Interfaces
18+
## Generic interfaces
1919

2020
Generic interfaces are a key feature of advanced generics, allowing you to define type-safe contracts for implementing classes. They're especially useful when you want to enforce consistent behavior across different types while maintaining flexibility.
2121

@@ -102,7 +102,7 @@ Action<string> handleString = handleObject; // Contravariance: object is a more
102102
> [!TIP]
103103
> Covariance is useful when reading data, such as, iterating through a collection. Contravariance is useful when writing or processing data, such as passing parameters to a method.
104104
105-
## Generic Math and Methods
105+
## Generic math and methods
106106

107107
.NET 7 introduces generic math interfaces, enabling mathematical operations across numeric types.
108108

learn-pr/wwl-azure/get-started-generic-anonymous-types/includes/4-practical-applications-anonymous-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Imagine you're preparing a quick summary of items in a warehouse. Instead of creating detailed records for each item, you jot down only the key details you need, like the name and price, on a temporary list. This approach helps you stay organized without unnecessary complexity. Anonymous types in C# work similarlythey let you group related data into a temporary object without defining a full class, making your code simpler and more efficient.
1+
Imagine you're preparing a quick summary of items in a warehouse. Instead of creating detailed records for each item, you jot down only the key details you need, like the name and price, on a temporary list. This approach helps you stay organized without unnecessary complexity. Anonymous types in C# work similarly they let you group related data into a temporary object without defining a full class, making your code simpler and more efficient.
22

33
## Understand the concept of anonymous types
44

learn-pr/wwl-azure/get-started-generic-anonymous-types/includes/7-summary.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
In this module, we addressed the challenge of creating flexible, reusable, and type-safe code in C#. We explored generics, advanced generic features, and anonymous types to simplify programming tasks, improve performance, and enhance code efficiency. By using generics and anoymous types, developers can write adaptable and efficient programs that handle varying data types and complex scenarios with ease.
1+
In this module, we addressed the challenge of creating flexible, reusable, and type-safe code in C#. We explored generics, advanced generic features, and anonymous types to simplify programming tasks, improve performance, and enhance code efficiency. By using generics and anonymous types, developers can write adaptable and efficient programs that handle varying data types and complex scenarios with ease.
22

33
After completing this module, you're now able to:
44

@@ -11,5 +11,5 @@ After completing this module, you're now able to:
1111

1212
- [Generics in C#](/dotnet/csharp/programming-guide/generics/)
1313
- [Covariance and Contravariance in C#](/dotnet/csharp/programming-guide/concepts/covariance-contravariance/)
14-
- [Anonymous Types in C#](/en-us/dotnet/csharp/programming-guide/classes-and-structs/anonymous-types)
14+
- [Anonymous Types in C#](/dotnet/csharp/programming-guide/classes-and-structs/anonymous-types)
1515
- [Generic Math in .NET 7](/dotnet/generic-math-in-csharp-and-vb/)

0 commit comments

Comments
 (0)