public Subcategory GetSubcategory(int id) { return(Subcategories.First(sub => sub.ID == id)); }
public Category GetCategoryForSubcategory(int id) { return(Subcategories.First(sub => sub.ID == id)?.Category); }
public void UpdateSubcategory(Subcategory subcategory) { Subcategories.Remove(Subcategories.First(sub => sub.ID == subcategory.ID)); Subcategories.Add(subcategory); }