示例#1
0
        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());
        }
示例#2
0
 // GET: Product
 public ActionResult Index(string productName)
 {
     var model = new Product {Name = productName};
     return View(model);
 }
示例#3
0
 private static string GetRef(Product product)
 {
     return product.Ref.ToLowerInvariant();
 }
示例#4
0
 private static string GetBrand(Product product)
 {
     return product.Brand.Name.ToLowerInvariant();
 }