Пример #1
0
        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);
        }
Пример #2
0
        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;
        }
Пример #3
0
        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();
        }