public static void UpdateTyping(LoginUser loginUser, int id, ChatParticipantType participantType, int chatID) { ChatParticipants chatParticipants = new ChatParticipants(loginUser); using (SqlCommand command = new SqlCommand()) { command.CommandText = @" UPDATE ChatParticipants SET LastTyped = GETUTCDATE() WHERE ChatID = @ChatID AND ParticipantType = @ParticipantType AND ParticipantID = @ParticipantID "; command.CommandType = CommandType.Text; command.Parameters.AddWithValue("@ChatID", chatID); command.Parameters.AddWithValue("@ParticipantType", (int)participantType); command.Parameters.AddWithValue("@ParticipantID", id); chatParticipants.ExecuteNonQuery(command, "ChatParticipants"); } }