private async Task SetReferenceData(ProductCreateModel model) { model.AvailableAlequots = (await _biopsyStore.GetAlequotsAsync()).Select(a => new SelectListItem() { Text = a.Id, Value = a.Id }); model.AvailableProductTypes = (await _productStore.GetProductTypesAsync()).Select(a => new SelectListItem() { Text = a.Name, Value = a.Id.ToString() }); }
// GET: /Product/Create public async Task<ActionResult> Create() { var model = new ProductCreateModel(); await SetReferenceData(model); return View(model); }