File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
src/BehavioralPatterns/TemplateMethod/TemplateMethodLibrary/BreadExample Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ public void Make()
1414 Slice ( ) ;
1515 }
1616
17- public abstract void MixIngredients ( ) ;
17+ protected abstract void MixIngredients ( ) ;
1818
19- public abstract void Bake ( ) ;
19+ protected abstract void Bake ( ) ;
2020
21- public virtual void Slice ( )
21+ protected virtual void Slice ( )
2222 {
2323 Console . WriteLine ( $ "Slicing the { GetType ( ) . Name } !") ;
2424 }
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ namespace TemplateMethodLibrary.BreadExample
44{
55 public class WhiteBread : Bread
66 {
7- public override void MixIngredients ( )
7+ protected override void MixIngredients ( )
88 {
99 Console . WriteLine ( "Gathering ingredients for white bread." ) ;
1010 }
1111
12- public override void Bake ( )
12+ protected override void Bake ( )
1313 {
1414 Console . WriteLine ( "Baking the white bread for 15 minutes." ) ;
1515 }
Original file line number Diff line number Diff line change @@ -4,12 +4,12 @@ namespace TemplateMethodLibrary.BreadExample
44{
55 public class WholeWheatBread : Bread
66 {
7- public override void MixIngredients ( )
7+ protected override void MixIngredients ( )
88 {
99 Console . WriteLine ( "Gathering ingredients for whole wheat bread." ) ;
1010 }
1111
12- public override void Bake ( )
12+ protected override void Bake ( )
1313 {
1414 Console . WriteLine ( "Baking the whole wheat bread for 20 minutes." ) ;
1515 }
You can’t perform that action at this time.
0 commit comments