Пример #1
0
        //#6
        static GenericController <Item> CreateGenericItemServices()
        {
            var reader  = new Reader <Item>();
            var saver   = new Saver <Item>();
            var deleter = new Deleter <Item>();

            //was not able to access
            void CreateItem(Item item)
            {
                saver.Save(item);
                Console.WriteLine("CreateOrder: Saving order of " + item.product);
            }

            //was not able to access
            void DeleteItem(Item item)
            {
                deleter.Delete(item);
                Console.WriteLine("DeleteOrder: Delete order of " + item.product);
            }

            // This must be declared using reflection...
            GenericController <Item> ctl = (GenericController <Item>)Activator.CreateInstance(typeof(GenericController <Item>), reader, saver, deleter);

            //This does not work
            //GenericController<Order> ctl = new GenericController(reader, saver, deleter);
            return(ctl);
        }
Пример #2
0
 public void Delete(Uri uri)
 {
     Deleter.Delete(uri);
 }