static void Main() { NHibernateService.OpenSessionFactory(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); PrijavaForm form = new PrijavaForm(); PrijavaPresenter presenter = new PrijavaPresenter(form, new UnitOfWork()); form.Show(); Application.Run(); }
static void Main() { ISessionFactory sessionFactory = NHibernateService.OpenSessionFactory(); //NHibernateService. WindowFormsFactory formsFactory = new WindowFormsFactory(); IRepositoryFactory repositoryFactory = new RepositoryFactory(sessionFactory); MainFormController mainController = new MainFormController(formsFactory, repositoryFactory); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMainWindow(mainController)); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { NHibernateService.OpenSessionFactory(); if (env.IsDevelopment()) { app.UseBrowserLink(); app.UseDeveloperExceptionPage(); } else { app.UseExceptionHandler("/Home/Error"); } app.UseStaticFiles(); app.UseAuthentication(); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }