public string Build(Product product) { if (product.Brand == null || string.IsNullOrEmpty(product.Brand.Name) || string.IsNullOrEmpty(product.Ref)) { throw new ArgumentException(); } return Build( GetBrand(product), GetRef(product), product.Id.ToString()); }
// GET: Product public ActionResult Index(string productName) { var model = new Product {Name = productName}; return View(model); }
private static string GetRef(Product product) { return product.Ref.ToLowerInvariant(); }
private static string GetBrand(Product product) { return product.Brand.Name.ToLowerInvariant(); }