// GET: /Alequot/Create public async Task <ActionResult> Create() { var model = new AlequotCreateModel(); await SetBiopsyOnModel(model); return(View(model)); }
public async Task <ActionResult> Create([Bind(Include = "Id,BiopsyId")] AlequotCreateModel alequotModel) { if (ModelState.IsValid) { var alequot = new Alequot() { BiopsyId = alequotModel.BiopsyId, Id = alequotModel.Id }; await _biopsyStore.AddAlequotAsync(alequot); return(RedirectToAction("Index")); } await SetBiopsyOnModel(alequotModel); return(View(alequotModel)); }
private async Task SetBiopsyOnModel(AlequotCreateModel model) { model.Biopsies = (await _biopsyStore.GetBiopsiesAsync()).Select(BiopsyToSelectListItem); }