Пример #1
0
        static void Main(string[] args)
        {
            //通过接口反射出实现类(Assembly),并缓存已使用过的接口
            for (int i = 0; i < 10; i++)
            {
                Task.Run(() =>
                {
                    IStudyService study = CreateImplement.ImplementCreate <IStudyService>();
                    study.Study();

                    ISheepService sheep = CreateImplement.ImplementCreate <ISheepService>();
                    sheep.Sheep();

                    IPalyService paly = CreateImplement.ImplementCreate <IPalyService>();
                    paly.Paly();
                });
            }
            Console.ReadKey();
        }
Пример #2
0
 public SheepController(ISheepService sheepService, IStatusService statusService, IMapper mapper)
 {
     _sheepService = sheepService;
     _statusService = statusService;
     _mapper = mapper;
 }