Example #1
0
        public IEnumerable <Discount> GetFromSource()
        {
            var products = ProductRepository.GetFromSource();

            var rules = RuleRepository.GetFromSource();

            return(Table.Select(d =>
                                new Model.Discount(
                                    rules.First(r => r.Id == d.RuleId),
                                    products.First(p => p.Id == d.TargetProductId),
                                    d.MemberName,
                                    d.Method,
                                    d.TargetValue
                                    )));
        }
Example #2
0
 public DiscountRepository(RuleRepository ruleRepository, ProductRepository productRepository)
 {
     RuleRepository    = ruleRepository;
     ProductRepository = productRepository;
 }