private ProjectModel PopulateProjectModel(Project project) { ProjectModel proj = Mapper.Map<Project, ProjectModel>(project); NotificationSettings notificationSettings = project.GetNotificationSettings(User.UserEntity.Id) ?? new NotificationSettings(); proj.Mode = notificationSettings.Mode; proj.SendDailySummary = notificationSettings.SendDailySummary; proj.ReportCriticalErrors = notificationSettings.ReportCriticalErrors; proj.ReportRegressions = notificationSettings.ReportRegressions; proj.Report404Errors = notificationSettings.Report404Errors; proj.ReportKnownBotErrors = notificationSettings.ReportKnownBotErrors; proj.OrganizationName = _organizationRepository.GetByIdCached(project.OrganizationId).Name; proj.UserId = User.UserEntity.Id; return proj; }
private ProjectModel PopulateProjectModel(Project project) { var user = GetUser(); ProjectModel p = Mapper.Map<Project, ProjectModel>(project); NotificationSettings notificationSettings = project.GetNotificationSettings(user.Id) ?? new NotificationSettings(); p.Mode = notificationSettings.Mode; p.SendDailySummary = notificationSettings.SendDailySummary; p.ReportCriticalErrors = notificationSettings.ReportCriticalErrors; p.ReportRegressions = notificationSettings.ReportRegressions; p.Report404Errors = notificationSettings.Report404Errors; p.ReportKnownBotErrors = notificationSettings.ReportKnownBotErrors; p.OrganizationName = _organizationRepository.GetById(project.OrganizationId, true).Name; p.UserId = user.Id; return p; }