Ejemplo n.º 1
0
        // GET: /Alequot/Create
        public async Task <ActionResult> Create()
        {
            var model = new AlequotCreateModel();

            await SetBiopsyOnModel(model);

            return(View(model));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
 private async Task SetBiopsyOnModel(AlequotCreateModel model)
 {
     model.Biopsies = (await _biopsyStore.GetBiopsiesAsync()).Select(BiopsyToSelectListItem);
 }