public static void Init() { try { DBContext context = new DBContext(); if (!context.Database.Exists()) { context.Database.Initialize(true); //context.Database.ExecuteSqlCommand("ALTER TABLE TimeSheet ADD CONSTRAINT IX_CurrentDate_UserId_ProjectId UNIQUE (CurrentDate,UserId,ProjectId)"); } //ToolingFacade facade = new ToolingFacade(typeof(Dot.Demo.Project).Assembly.FullName, // typeof(Dot.Demo.Project).Assembly.FullName, // typeof(Dot.Demo.Migrations.Configuration).FullName, // AppDomain.CurrentDomain.BaseDirectory + "bin", // AppDomain.CurrentDomain.BaseDirectory + "Web.config", // null, // new DbConnectionInfo(Constant.ConnectionName.EntityString)); //facade.Update(null, false); } catch (Exception ex) { Dot.Utility.Log.LogFactory.BusinessExceptionLog.Error(ex.Message, ex); } }
public ActionResult Index() { ViewBag.Title = "Home Page"; Dot.Utility.DotEnvironment.MapDllPath("config/license.lic"); var dlist= new Dot.Demo.DBContext().Context.Database.SqlQuery<Project>("select * from project").ToList(); IProjectService service = ObjectContainer.CreateInstance<IProjectService>(); var list = service.GetList(); var one = service.Get(m => m.Id == 1); HomeIndexModel model = new HomeIndexModel(); model.div = JsonConvert.SerializeObject(Dot.Config.Model.PlatformConfig.ServerConfig.KeyValueSettings["test"]); return View(model); }
public ActionResult Index() { ViewBag.Title = "Home Page"; Dot.Utility.DotEnvironment.MapDllPath("config/license.lic"); var dlist = new Dot.Demo.DBContext().Context.Database.SqlQuery <Project>("select * from project").ToList(); IProjectService service = ObjectContainer.CreateInstance <IProjectService>(); var list = service.GetList(); var one = service.Get(m => m.Id == 1); HomeIndexModel model = new HomeIndexModel(); model.div = JsonConvert.SerializeObject(Dot.Config.Model.PlatformConfig.ServerConfig.KeyValueSettings["test"]); return(View(model)); }