public BoardPostViewModel GetBoardPostViewModel(Post p)
 {
     BoardPostViewModel bpvm = new BoardPostViewModel();
     bpvm.access_level_id = p.Account.access_level_id;
     if (p.Editor == null || p.date_edited == null)
     {
         bpvm.date_edited_text = "";
     }
     else
     {
         bpvm.date_edited_text = "Edited by " + p.Editor.username + " on " + p.date_edited.ToString() + ".";
     }
     bpvm.date_posted_text = p.date_posted.ToString();
     bpvm.entry = p.entry;
     bpvm.id = p.id;
     bpvm.account_id = p.account_id;
     bpvm.joined_date_text = "Member since " + p.Account.birthdate.ToString("MMMM d, yyyy");
     bpvm.username = p.Account.username;
     bpvm.name = p.Account.first_name + " " + p.Account.last_name;
     List<LinkedItemViewModel> l_livm = new List<LinkedItemViewModel>();
     foreach(LinkedItem li in p.LinkedItems.ToList())
     {
         LinkedItemViewModel livm = new LinkedItemViewModel();
         livm.id = li.item_id;
         livm.item_name = li.Item.name;
         l_livm.Add(livm);
     }
     bpvm.linked_items = l_livm;
     return bpvm;
 }
 private List<LinkedItemViewModel> GetAllItemsAsLinkedItems()
 {
     List<LinkedItemViewModel> l_livm = new List<LinkedItemViewModel>();
     int ix = 0;
     foreach(Item i in db.Items.ToList())
     {
         LinkedItemViewModel livm = new LinkedItemViewModel();
         livm.num = ix;
         livm.id = i.id;
         livm.image_src = GetImageURL(i.name + ".png");
         livm.isChecked = false;
         livm.item_name = i.name;
         l_livm.Add(livm);
         ix++;
     }
     return l_livm;
 }