public UserData AddUserData(UserData model) { _context.Add(model); _context.SaveChanges(); return(model); }
public GroupUser AddGroupUser(GroupUser groupUser) { _context.Add(groupUser); _context.SaveChanges(); return(groupUser); }
public Comment AddComment(Comment comment) { _context.Add(comment); _context.SaveChanges(); return(comment); }
public async Task SendMessage(string text, string connectionid, string url, string senderName) { var httpContext = this.Context.GetHttpContext(); var token = httpContext.Request.Cookies["user-token"]; var myprofile = _profileRepository.GetUserByToken(token); var recipient = _context.Users.FirstOrDefault(u => u.ConectionId == connectionid); Notification notification = new Notification { IsRead = false, Url = url, SenderName = senderName, SendDate = DateTime.Now, UserId = recipient.Id, Text = text }; _context.Add(notification); _context.SaveChanges(); await Clients.Client(connectionid).SendAsync("RecieveMessage", text, url, senderName); }
public void AddCommentReaction(CommentReaction commentReaction) { _context.Add(commentReaction); _context.SaveChanges(); }