Skip to content

Commit 2680077

Browse files
CopilotBillWagner
andauthored
Fix date typos and terminology in default interface methods tutorial (#47375)
* Initial plan * Fix date typos and terminology in default interface methods tutorial Co-authored-by: BillWagner <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: BillWagner <[email protected]>
1 parent d23fc9f commit 2680077

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docs/csharp/advanced-topics/interface-implementation/default-interface-methods-versions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Notice the following portion of the test:
5858

5959
:::code language="csharp" source="./snippets/default-interface-members-versions/finished/customer-relationship/Program.cs" id="SnippetHighlightCast":::
6060

61-
That cast from `SampleCustomer` to `ICustomer` is necessary. The `SampleCustomer` class doesn't need to provide an implementation for `ComputeLoyaltyDiscount`; that's provided by the `ICustomer` interface. However, the `SampleCustomer` class doesn't inherit members from its interfaces. That rule hasn't changed. In order to call any method declared and implemented in the interface, the variable must be the type of the interface, `ICustomer` in this example.
61+
That implicit conversion from `SampleCustomer` to `ICustomer` is necessary. The `SampleCustomer` class doesn't need to provide an implementation for `ComputeLoyaltyDiscount`; that's provided by the `ICustomer` interface. However, the `SampleCustomer` class doesn't inherit members from its interfaces. That rule hasn't changed. In order to call any method declared and implemented in the interface, the variable must be the type of the interface, `ICustomer` in this example.
6262

6363
## Provide parameterization
6464

docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/finished/customer-relationship/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
Reminders =
66
{
77
{ new DateTime(2010, 08, 12), "childs's birthday" },
8-
{ new DateTime(1012, 11, 15), "anniversary" }
8+
{ new DateTime(2012, 11, 15), "anniversary" }
99
}
1010
};
1111

1212
SampleOrder o = new SampleOrder(new DateTime(2012, 6, 1), 5m);
1313
c.AddOrder(o);
1414

15-
o = new SampleOrder(new DateTime(2103, 7, 4), 25m);
15+
o = new SampleOrder(new DateTime(2013, 7, 4), 25m);
1616
c.AddOrder(o);
1717

1818
// <SnippetHighlightCast>

docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/starter/customer-relationship/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
Reminders =
66
{
77
{ new DateTime(2010, 08, 12), "childs's birthday" },
8-
{ new DateTime(1012, 11, 15), "anniversary" }
8+
{ new DateTime(2012, 11, 15), "anniversary" }
99
}
1010
};
1111

1212
SampleOrder o = new SampleOrder(new DateTime(2012, 6, 1), 5m);
1313
c.AddOrder(o);
1414

15-
o = new SampleOrder(new DateTime(2103, 7, 4), 25m);
15+
o = new SampleOrder(new DateTime(2013, 7, 4), 25m);
1616
c.AddOrder(o);
1717

1818
Console.WriteLine($"Data about {c.Name}");

0 commit comments

Comments
 (0)