public IActionResult Create(Drug model)
 {
     if (ModelState.IsValid)
     {
         _DrugRepository.Create(model);
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
Esempio n. 2
0
        public async Task <ActionResult <Drug> > CreateDrug(Drug drug)
        {
            await _drugRepository.Create(drug);

            return(CreatedAtAction("GetDrugById", new { id = drug.Id }, drug));
        }