static void Main(string[] allInputString) { dbi298845_prangersEntities database = new dbi298845_prangersEntities(); countrycode countrycode = GetOrCreateDefaultCountryCode(database); // Create the router to route the commands through. CommandRouter commandRouter = new CommandRouter(database, countrycode); // Register all possible commands. commandRouter.Register(new CommandImportPostalCode()); commandRouter.Register(new CommandImportStore()); commandRouter.Register(new CommandImportBottom()); commandRouter.Register(new CommandImportProduct()); commandRouter.Register(new CommandImportIngredient()); commandRouter.Register(new CommandImportPizzaIngredient()); commandRouter.Register(new CommandParseMapping()); commandRouter.Register(new CommandImportOrder()); // Execute the command commandRouter.Execute(allInputString); Console.ReadKey(); }
public static void InitializeRouter() { CommandRouter .Register <ICommand, ICommandHandler>(typeof(GetRandomNumberOfGuidsCommand), typeof(GetRandomNumberOfGuidsCommandHandler)) .Register <ICommand, ICommandHandler>(typeof(GetRestaurantsByNameCommand), typeof(GetRestaurantsByNameCommandHandler)); }