public async Task <ActionResult <object> > PostProfile(СonversationDocumentModel ajaxConversation) { _context.Сonversations.Add(ajaxConversation); await _context.SaveChangesAsync(); return(null); // CreatedAtAction("GetСonversationModel", new { id = сonversationModel.Id }, сonversationModel); }
public async Task <ActionResult <object> > DeleteProfile(int id) { СonversationDocumentModel сonversation = await _context.Сonversations.FindAsync(id); if (сonversation == null) { return(null); // NotFound(); } _context.Сonversations.Remove(сonversation); await _context.SaveChangesAsync(); return(null); // сonversationModel; }
public async Task <IActionResult> PutProfile(int id, СonversationDocumentModel ajaxConversation) { if (id != ajaxConversation.Id) { return(null); // BadRequest(); } _context.Entry(ajaxConversation).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (Exception ex) { throw; } return(null); // NoContent(); }