public string GetFullCatLocation(CarCategory cat) { if (cat.CatLevel == 1) return db.CarCategories.FirstOrDefault(x => x.CatID == cat.CatParentID).CatName + " » " + cat.CatName; else return cat.CatName; }
public string GetFullCatLocation(CarCategory cat) { if (cat.CatLevel == 1) { return(db.CarCategories.FirstOrDefault(x => x.CatID == cat.CatParentID).CatName + " » " + cat.CatName); } else { return(cat.CatName); } }