public ActionResult NewType(String[] attributes, ProductType productType) { var attributeDefs = schemaService.GetAttributes(attributes); productType.Attributes.AddRange(attributeDefs); schemaService.SaveProductType(productType); var productTypes = schemaService.GetProductTypes(); return PartialView("Types/Index", productTypes); }
public void SaveProductType(ProductType productType) { mongoService .GetCollection<ProductType>("types") .Save(productType); }
public ActionResult NewType() { var type = new ProductType(); var attributes = schemaService.GetAttributes(); var model = new NewProductTypeModel() { ProductType = type, Attributes = attributes }; return PartialView("Types/Edit", model); }