示例#1
0
 public App()
 {
     MainRepository = new EFMainRepository();
     AuctionRunner  = new AuctionRunner(MainRepository);
     this.AuctionRunner.Start();
     InitializeTestData();
 }
示例#2
0
 public IMainRepository CreateMainRepository()
 {
     if (instance == null)
     {
         instance = new EFMainRepository();
     }
     return(instance);
 }
示例#3
0
        public AuctionController()
        {
            var repo = new EFMainRepository();

            this.memberService = new SimpleMemberService(repo);

            this.auctionService = new AuctionService(repo, this.memberService);
        }
        public IMainRepository CreateMainRepository()
        {
            var repo = new EFMainRepository();

            if (!this.repos.Any())
            {
                repo.Database.Delete();
            }

            this.repos.Add(repo);

            return(repo);
        }
示例#5
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            // DotNetBay startup
            var mainRepository = new EFMainRepository();

            mainRepository.SaveChanges();

            AuctionRunner = new AuctionRunner(mainRepository);
            AuctionRunner.Start();
        }
示例#6
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            // DotNetBay startup
            var mainRepository = new EFMainRepository();

            mainRepository.SaveChanges();

            // SignalR Configuration
            var serializerSettings = new JsonSerializerSettings();

            serializerSettings.ReferenceLoopHandling      = ReferenceLoopHandling.Serialize;
            serializerSettings.PreserveReferencesHandling = PreserveReferencesHandling.Objects;

            var serializer = JsonSerializer.Create(serializerSettings);

            GlobalHost.DependencyResolver.Register(typeof(JsonSerializer), () => serializer);

            AuctionRunner = new AuctionRunner(mainRepository);

            AuctionRunner.Auctioneer.BidAccepted += (sender, args) =>
            #pragma warning disable SA1501 // Statement must not be on a single line
            { AuctionsHub.NotifyBidAccepted(args.Auction, args.Bid); };

            AuctionRunner.Auctioneer.BidDeclined += (sender, args) =>
            { AuctionsHub.NotifyBidDeclined(args.Auction, args.Bid); };

            AuctionRunner.Auctioneer.AuctionStarted += (sender, args) =>
            { AuctionsHub.NotifyAuctionStarted(args.Auction); };

            AuctionRunner.Auctioneer.AuctionEnded += (sender, args) =>
            { AuctionsHub.NotifyAuctionEnded(args.Auction); };

            #pragma warning restore SA1501 // Statement must not be on a single line
            AuctionRunner.Start();
        }
示例#7
0
 public AuctionsController()
 {
     this.mainRepository = new EFMainRepository();
     this.service        = new AuctionService(this.mainRepository, new SimpleMemberService(this.mainRepository));
 }
示例#8
0
 public HealthMiddleware(OwinMiddleware next, string route) : base(next)
 {
     this.route = route;
     repository = new EFMainRepository();
 }
示例#9
0
 public IMainRepository CreateMainRepository()
 {
     repository = new EFMainRepository();
     return(repository);
 }
 public RemoteAuctionService()
 {
     this.repository = new EFMainRepository();
 }
示例#11
0
 public HealthMiddleware(OwinMiddleware next) : base(next)
 {
     this.repository = new EFMainRepository();
 }
示例#12
0
 public AuctionController()
 {
     repository = new EFMainRepository();
     service    = new AuctionService(repository, new SimpleMemberService(repository));
 }