Beispiel #1
0
        public void AddMessageInChatroom(int id, [FromBody] Message message)
        {
            message.SentDate   = DateTime.Now;
            message.ChatroomID = id;

            try
            {
                service.AddMessageInChatroom(message);
            }
            catch (ArgumentNullException)
            {
                throw new HttpResponseException(HttpStatusCode.NotFound);
            }
            catch (InvalidOperationException)
            {
                throw new HttpResponseException(HttpStatusCode.NotAcceptable);
            }
        }