public IActionResult Create([FromBody] NoteItem item) { if (item == null) { return(BadRequest()); } m_context.NoteItems.Add(item); m_context.SaveChanges(); return(CreatedAtRoute("GetNote", new { ID = item.ID }, item)); }
public IActionResult Create([FromBody] MotdItem item) { if (item == null) { Console.WriteLine("MITÄ VITTU"); return(BadRequest()); } m_context.MotdItems.Add(item); m_context.SaveChanges(); return(CreatedAtRoute("GetMotd", new { ID = item.ID }, item)); }