| 123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace FactoryPattern
- {
- public abstract class AbstractCar
- {
- protected abstract void DoOperation();
- public void GetInfo()
- {
- Console.WriteLine($"I am {this.GetType().Name}.");
- }
- }
- public class ConcreateCarA : AbstractCar
- {
- protected override void DoOperation()
- {
-
- throw new System.NotImplementedException();
- }
- }
- public class ConcreateCarB : AbstractCar
- {
- protected override void DoOperation()
- {
- throw new System.NotImplementedException();
- }
- }
- }
|