Exemplo n.º 1
0
        private static void TestCreators()
        {
            IEnumerable <ICreator> creators = new List <ICreator>();

            while (true)
            {
                Console.WriteLine("Press Enter to Add Creator; type 'exit' to quit.");

                var input = Console.ReadLine();

                Console.Clear();

                if (input.Equals("exit", StringComparison.OrdinalIgnoreCase))
                {
                    break;
                }

                string name = "John Cossu";

                if (DateTime.Now.Second % 2 == 0)
                {
                    name = "Christian Micklish";
                }

                ICreator newCreator = new Creator($"{name} _ {DateTime.Now}", "MyJson");

                newCreator = CreatorDao.Add(newCreator);

                creators = CreatorDao.Get();

                foreach (ICreator creator in creators)
                {
                    Console.WriteLine($"ID: {creator.Id} / Name: {creator.Name}");
                }

                Console.WriteLine(Environment.NewLine + Environment.NewLine);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets all creators
 /// </summary>
 /// <returns></returns>
 public IEnumerable <ICreator> GetCreators()
 {
     return(CreatorDao.Get());
 }