예제 #1
0
        // GET: /Alequot/Create
        public async Task <ActionResult> Create()
        {
            var model = new AlequotCreateModel();

            await SetBiopsyOnModel(model);

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