public ActionResult <dynamic> Post([FromBody] SLI sli) { var newSli = new ShoppingListItem { Text = sli.Text }; _context.Add(newSli); _context.SaveChanges(); return(newSli); }
public ActionResult <dynamic> Post([FromBody] WMI wmi) { var newWmi = new WeeklyMenuItem { Date = wmi.Date, Recipe = _context.Set <Recipe>().Find(wmi.Recipe) }; _context.Add(newWmi); _context.SaveChanges(); return(newWmi); }