public static void Main()
        {
            Console.WriteLine("DotNetBay Commandline");

            AuctionRunner auctionRunner = null;

            try
            {
                var store = new FileSystemMainRepository("store.json");
                var auctionService = new AuctionService(store, new SimpleMemberService(store));

                auctionRunner = new AuctionRunner(store);

                Console.WriteLine("Started AuctionRunner");
                auctionRunner.Start();

                var allAuctions = auctionService.GetAll();

                Console.WriteLine("Found {0} auctions returned by the service.", allAuctions.Count());

                Console.Write("Press enter to quit");
                Console.ReadLine();
            }
            finally
            {
                if (auctionRunner != null)
                {
                    auctionRunner.Dispose();
                }
            }

            Environment.Exit(0);
        }
Exemple #2
0
 public static IAuctionRunner GetInstance(IMainRepository repository, TimeSpan checkInterval)
 {
     if (AuctionRunner.instance == null)
     {
         instance = new AuctionRunner(repository, checkInterval);
     }
     return(instance);
 }
Exemple #3
0
        public static void Main(string[] args)
        {
            var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance;

            Console.WriteLine("DotNetBay Commandline");

            var store = new FileSystemMainRepository("store.json");

            var auctionService = new AuctionService(store, new SimpleMemberService(store));
            var auctionRunner = new AuctionRunner(store);

            Console.WriteLine("Started AuctionRunner");
            auctionRunner.Start();

            var allAuctions = auctionService.GetAll();

            Console.WriteLine("Found {0} auctions returned by the service.", allAuctions.Count());

            Console.Write("Press enter to quit");
            Console.ReadLine();

            Environment.Exit(0);
        }
Exemple #4
0
 public static IAuctionRunner GetInstance(IMainRepository repository)
 {
     return(AuctionRunner.GetInstance(repository, TimeSpan.FromSeconds(5)));
 }