Пример #1
0
        public List <EntityProduct> GetAllEntityProducts()
        {
            List <EntityProduct> products = new List <EntityProduct>();

            return(ExecuteFaultHandledOperation(() =>
            {
                IEntityProductRepository entity_product_repo = _data_repository_factory.GetDataRepository <IEntityProductRepository>();
                IProductRepository prod_repository = _data_repository_factory.GetDataRepository <IProductRepository>();
                IEnumerable <EntityProductData> entity_prods = entity_product_repo.GetAll();

                foreach (EntityProductData entity_prod in entity_prods)
                {
                    ProductData prod_data = prod_repository.GetByID(entity_prod.ProductKey);
                    products.Add(Map(entity_prod, prod_data));
                }
                return products;
            }));
        }
Пример #2
0
        public List <EntityProduct> GetEntityProductsByEntity(int entity_key, QIQOEntityType entity_type)
        {
            return(ExecuteFaultHandledOperation(() =>
            {
                IEntityProductRepository entity_product_repo = _data_repository_factory.GetDataRepository <IEntityProductRepository>();
                IProductRepository product_repo = _data_repository_factory.GetDataRepository <IProductRepository>();
                List <EntityProduct> entity_products = new List <EntityProduct>();

                IEnumerable <EntityProductData> entity_products_data = entity_product_repo.GetAll(entity_key, (int)entity_type);

                foreach (EntityProductData entity_product_data in entity_products_data)
                {
                    ProductData product_data = product_repo.GetByID(entity_product_data.ProductKey);
                    EntityProduct entity_product = Map(entity_product_data, product_data);
                    entity_products.Add(entity_product);
                }
                return entity_products;
            }));
        }