示例#1
0
        public async Task <Response <Message> > AddAMessageAsync(string content, int receiverId)
        {
            try
            {
                var message = _messageFactory.CreateAMessage(content, receiverId);
                await _repo.AddAMessageAsync(message, receiverId);

                await _unitWork.CommitAsync();

                return(new Response <Message>(message));
            }
            catch (Exception e)
            {
                return(new Response <Message>($"ERROR :{e.Message}"));
            }
        }