public static void GetRecursorWithDapper(Models.Project.ProjectModel pm) { var dapperRepo = new BlueMine.Data.Dapper.CRUD(); System.Collections.Generic.List <Db.T_projects> projects = dapperRepo.GetProjects(); pm.GenericTree = new BlueMine.Data.GenericRecursor <Db.T_projects, long?>( projects , x => x.parent_id , x => x.id ); // pm.GenericTree.AddSort(SortTerm<Db.T_projects>.Create(x => x.id)); // pm.GenericTree.AddSort(SortTerm<Db.T_projects>.Create(x => x.id, SortDirection.Descending)); //pm.GenericTree.AddSort( // SortTerm<Db.T_projects>.Create(x => x.name) // , SortTerm<Db.T_projects>.Create(x => x.created_on) // , SortTerm<Db.T_projects>.Create(x => x.id) // , SortTerm<Db.T_projects>.Create(x => x.parent_id) //); // pm.GenericTree.AddSort(x => x.name, SortDirection.Ascending); // pm.GenericTree.AddSort(x => x.created_on, SortDirection.Ascending); // pm.GenericTree.AddSort(x => x.id, SortDirection.Ascending); // pm.GenericTree.AddSort(x => x.parent_id, SortDirection.Ascending); pm.GenericTree.AddSort(x => x.name); // @Html.DisplayFor((from prop in Model where prop.parent_id != null select prop), "T_projects") // @Html.DisplayForModel() // @Html.EditorForModel() }
public static void GetProjectTreeWithDapper(Models.Project.ProjectModel pm) { var dapperRepo = new BlueMine.Data.Dapper.CRUD(); System.Collections.Generic.List <Db.T_projects> projects = dapperRepo.GetProjects(); pm.ProjectTree = new Models.Project.ProjectRecursor(projects); }
public ValuesController(BlueMine.Db.BlueMineContext dbContext) { this.m_BlueMineContext = dbContext; // this.m_Repo = new BlueMine.Data.CRUD(dbContext); this.m_DapperRepo = new BlueMine.Data.Dapper.CRUD(); }
public ProjectModelFactory(BlueMineRepository repository) { this.m_repo = repository; this.m_DapperRepo = new BlueMine.Data.Dapper.CRUD(); }