Пример #1
0
 /// <summary>
 /// ctor the Mighty
 /// </summary>
 public RecipeController(IUnitOfWorkFactory <BrewgrContext> unitOfWorkFactory, IRecipeService recipeService, IBeerStyleService beerStyleService,
                         IStaticContentService staticContentService, IUserService userService, INotificationService notificationService, IPartnerIdResolver partnerIdResolver,
                         IBeerXmlRecipeExporter beerXmlExporter, IBeerXmlRecipeImporter beerXmlImporter, IPartnerService partnerService, ISendToShopService sendToShopService)
 {
     this.UnitOfWorkFactory    = unitOfWorkFactory;
     this.RecipeService        = recipeService;
     this.BeerStyleService     = beerStyleService;
     this.StaticContentService = staticContentService;
     this.UserService          = userService;
     this.NotificationService  = notificationService;
     this.PartnerIdResolver    = partnerIdResolver;
     this.BeerXmlExporter      = beerXmlExporter;
     this.BeerXmlImporter      = beerXmlImporter;
     this.PartnerService       = partnerService;
     this.SendToShopService    = sendToShopService;
 }
Пример #2
0
		/// <summary>
		/// ctor the Mighty
		/// </summary>
		public RecipeController(IUnitOfWorkFactory<BrewgrContext> unitOfWorkFactory, IRecipeService recipeService, IBeerStyleService beerStyleService, 
			IStaticContentService staticContentService, IUserService userService, INotificationService notificationService, IPartnerIdResolver partnerIdResolver,
			IBeerXmlRecipeExporter beerXmlExporter, IBeerXmlRecipeImporter beerXmlImporter, IPartnerService partnerService, ISendToShopService sendToShopService)
		{
			this.UnitOfWorkFactory = unitOfWorkFactory;
			this.RecipeService = recipeService;
			this.BeerStyleService = beerStyleService;
			this.StaticContentService = staticContentService;
            this.UserService = userService;
			this.NotificationService = notificationService;
			this.PartnerIdResolver = partnerIdResolver;
			this.BeerXmlExporter = beerXmlExporter;
			this.BeerXmlImporter = beerXmlImporter;
			this.PartnerService = partnerService;
			this.SendToShopService = sendToShopService;
		}
Пример #3
0
        static void Main(string[] args)
        {
            DynamicModuleUtility.RegisterModule(typeof(OnePerRequestHttpModule));
            DynamicModuleUtility.RegisterModule(typeof(NinjectHttpModule));
            bootstrapper.Initialize(NinjectWebCommon.CreateKernel);

            DirectoryInfo          dir      = new DirectoryInfo(@"d:\tmp\recipe\");
            IBeerXmlRecipeImporter importer = (IBeerXmlRecipeImporter)System.Web.Mvc.DependencyResolver.Current.GetService(typeof(IBeerXmlRecipeImporter));

            foreach (var file in dir.GetFiles())
            {
                try
                {
                    string text   = File.ReadAllText(file.FullName);
                    Recipe recipe = importer.Import(text);
                    Console.WriteLine($" recipe {recipe.RecipeName} imported");
                }
                catch (Exception ex)
                {
                }
            }
        }