Example #1
0
        public static void Main()
        {
            var catService = new CatService();

            var randomCats = catService.RandomCatsFromToday();

            foreach (var randomCat in randomCats)
            {
                Console.WriteLine(randomCat.Name);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            var container = new Container();

            container.Register <IAppSettings, AppSettings>();
            container.Register <IDateTimeProvider, DateTimeProvider>();
            container.Register <IRandomProvider, RandomProvider>();
            container.Register <IDbContext, DbContext>();
            container.Verify();

            CatService catService = container.GetInstance <CatService>();

            foreach (var cat in catService.GetRandomCatsFromToday())
            {
                Console.WriteLine(cat.Name);
            }
        }