public bool SendMessage(Messages model) { try { _context.Messages.Add(model); _context.SaveChanges(); return true; } catch { return false; } }
public bool SendMessage(string userId, string title, string desc) { Messages messageRow = new Messages { UserId = userId, Title = title, Description = desc, SendTime = DateTime.Now }; bool result = _userRepository.SendMessage(messageRow); return result; }