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

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

            result = new LineItemRepository(new EntityFrameworkRepository <Data.EF.bvc_LineItem>(
                                                new Data.EF.EntityFrameworkDevConnectionString(c.ConnectionStringForEntityFramework)), logger, c);
            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);
 }