public BiopsyIndexViewModel BiopsyToIndexModel(Biopsy biopsy) { return new BiopsyIndexViewModel() { Id = biopsy.Id, PatientId = biopsy.PatientId }; }
public async Task<ActionResult> Create([Bind(Include = "Id,PatientId")] BiopsyCreateModel biopsyModel) { if (ModelState.IsValid) { var biopsy = new Biopsy() { Id = biopsyModel.Id, PatientId = biopsyModel.PatientId }; await _biopsyStore.AddBiopsyAsync(biopsy); return RedirectToAction("Index"); } SetPatientsOnModel(biopsyModel); return View(biopsyModel); }
private SelectListItem BiopsyToSelectListItem(Biopsy biopsy) { return new SelectListItem() { Value = biopsy.Id, Text = biopsy.Id + (biopsy.PatientId ?? string.Empty) }; }