mirror of
https://github.com/lempamo/Project-Unite.git
synced 2025-02-03 13:17:33 +00:00
Parents list gets populated in AddWikiCategory
This commit is contained in:
parent
781fd9a52e
commit
1f6ab0dbbe
1 changed files with 16 additions and 1 deletions
|
@ -11,7 +11,22 @@ namespace Project_Unite.Models
|
||||||
{
|
{
|
||||||
public AddWikiCategoryViewModel()
|
public AddWikiCategoryViewModel()
|
||||||
{
|
{
|
||||||
|
var db = new ApplicationDbContext();
|
||||||
|
Parents = new List<SelectListItem>();
|
||||||
|
Parents.Add(new SelectListItem
|
||||||
|
{
|
||||||
|
Value = "none",
|
||||||
|
Text = "No parent"
|
||||||
|
});
|
||||||
|
foreach(var cat in db.WikiCategories)
|
||||||
|
{
|
||||||
|
Parents.Add(new SelectListItem
|
||||||
|
{
|
||||||
|
Value = cat.Id,
|
||||||
|
Text = cat.Name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
db.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SelectListItem> Parents { get; set; }
|
public List<SelectListItem> Parents { get; set; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue