Пример #1
0
        public Product Delete(Product product)
        {
            // Execute Business validation

            var command = new DeleteProductCommand(UnitOfWork, product);

            DataBusManager.ExecuteCommand(command);

            if (command.Success)
            {
                // Success execution
            }
            else if (command.Fail)
            {
                // Fail Execution
            }

            return(command.Product);
        }
Пример #2
0
        public List <Product> GetAll()
        {
            // Execute Business validation

            var products = new List <Product>();

            var command = new GetAllProductsCommand(UnitOfWork, products);

            DataBusManager.ExecuteCommand(command);

            if (command.Success)
            {
                // Success execution
            }
            else if (command.Fail)
            {
                // Fail Execution
            }

            return(command.Products);
        }