MCPcopy Create free account
hub / github.com/TryCatchLearn/Overflow / ReputationHelper

Class ReputationHelper

Reputation/ReputationHelper.cs:5–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3namespace Reputation;
4
5public static class ReputationHelper
6{
7 private static int GetDelta(ReputationReason reason) => reason switch
8 {
9 ReputationReason.QuestionUpvoted => 5,
10 ReputationReason.AnswerUpvoted => 5,
11 ReputationReason.QuestionDownvoted => -2,
12 ReputationReason.AnswerDownvoted => -2,
13 _ => 15
14 };
15
16 public static UserReputationChanged MakeEvent(
17 string userId,
18 ReputationReason reason,
19 string actorUserId,
20 DateTime? occurred = null)
21 => new(
22 UserId: userId,
23 Delta: GetDelta(reason),
24 Reason: reason,
25 ActorUserId: actorUserId,
26 Occurred: DateTime.UtcNow
27 );
28}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…