public static OrderCouponRepository InstantiateForMemory(RequestContext c)
        {
            OrderCouponRepository result = null;
            ILogger logger = new MerchantTribe.Commerce.EventLog();

            result = new OrderCouponRepository(new MemoryStrategy <Data.EF.bvc_OrderCoupon>(PrimaryKeyType.Long), logger);
            return(result);
        }
        public static OrderCouponRepository InstantiateForDatabase(RequestContext c)
        {
            OrderCouponRepository result = null;
            ILogger logger = new MerchantTribe.Commerce.EventLog();

            result = new OrderCouponRepository(new EntityFrameworkRepository <Data.EF.bvc_OrderCoupon>(
                                                   new Data.EF.EntityFrameworkDevConnectionString(c.ConnectionStringForEntityFramework)), logger);
            return(result);
        }
Exemple #3
0
 private OrderRepository(RequestContext c,
                         IRepositoryStrategy <Data.EF.bvc_Order> r,
                         IRepositoryStrategy <Data.EF.bvc_LineItem> itemr,
                         IRepositoryStrategy <Data.EF.bvc_OrderNote> noter,
                         IRepositoryStrategy <Data.EF.bvc_OrderCoupon> couponr,
                         IRepositoryStrategy <Data.EF.bvc_OrderPackage> packager,
                         ILogger log)
 {
     context           = c;
     repository        = r;
     this.logger       = log;
     repository.Logger = this.logger;
     itemRepository    = new LineItemRepository(itemr, this.logger);
     notesRepository   = new OrderNoteRepository(noter, this.logger);
     couponRepository  = new OrderCouponRepository(couponr, this.logger);
     packageRepository = new OrderPackageRepository(packager, this.logger);
 }