Skip to content

Commit 1cef022

Browse files
CopilotBillWagnergewarren
authored
Add context clarification comments to interface method code snippets (#47683)
* Initial plan * Add context clarification comments to interface method snippets Co-authored-by: BillWagner <[email protected]> * Fix code comments to end with periods per style guide Co-authored-by: gewarren <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: BillWagner <[email protected]> Co-authored-by: gewarren <[email protected]>
1 parent 532611d commit 1cef022

File tree

2 files changed

+4
-0
lines changed
  • docs/csharp/advanced-topics/interface-implementation/snippets/default-interface-members-versions/finished/customer-relationship

2 files changed

+4
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public interface ICustomer
1111

1212
/*
1313
// <SnippetLoyaltyDiscountVersionOne>
14+
// This method belongs in the ICustomer interface (ICustomer.cs).
1415
// Version 1:
1516
public decimal ComputeLoyaltyDiscount()
1617
{
@@ -26,6 +27,7 @@ public decimal ComputeLoyaltyDiscount()
2627

2728
/*
2829
// <SnippetLoyaltyDiscountVersionTwo>
30+
// These methods belong in the ICustomer interface (ICustomer.cs).
2931
// Version 2:
3032
public static void SetLoyaltyThresholds(
3133
TimeSpan ago,
@@ -65,6 +67,7 @@ public static void SetLoyaltyThresholds(TimeSpan ago, int minimumOrders, decimal
6567
private static decimal discountPercent = 0.10m;
6668

6769
// <SnippetFinalVersion>
70+
// These methods belong in the ICustomer interface (ICustomer.cs).
6871
public decimal ComputeLoyaltyDiscount() => DefaultLoyaltyDiscount(this);
6972
protected static decimal DefaultLoyaltyDiscount(ICustomer c)
7073
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public void AddOrder(IOrder order)
2626
}
2727

2828
// <SnippetOverrideAndExtend>
29+
// This method belongs in the SampleCustomer class (SampleCustomer.cs) that implements ICustomer.
2930
public decimal ComputeLoyaltyDiscount()
3031
{
3132
if (PreviousOrders.Any() == false)

0 commit comments

Comments
 (0)