public Logs CreateLogs(Logs logs) { logsRepository.CreateLogs(logs); Dictionary <Guid, List <DateTime> > HabitAndLogs = logsRepository.GetHabitAndLogsFromUserID(logs.UserID); BadgeHandler badge = new BadgeHandler(badgeService); Attach(badge); if (isDominating(logs)) { Broadcast(BadgeFactory.CreateBadge("Dominating", logs.UserID)); } if (isWorkaholic(HabitAndLogs)) { Broadcast(BadgeFactory.CreateBadge("Workaholic", logs.UserID)); } if (isEpicComeback(logs)) { Broadcast(BadgeFactory.CreateBadge("Epic Comeback", logs.UserID)); } return(logs); }