public IActionResult Create(Drug model) { if (ModelState.IsValid) { _DrugRepository.Create(model); return(RedirectToAction("Index")); } return(View(model)); }
public async Task <ActionResult <Drug> > CreateDrug(Drug drug) { await _drugRepository.Create(drug); return(CreatedAtAction("GetDrugById", new { id = drug.Id }, drug)); }