private ValidationSeverity DetermineSeverity() { var issueMax = Issues.Any() ? Issues.Max(i => i.Severity) : ValidationSeverity.None; var reportMax = SubReports.Any() ? SubReports.Max(i => i.Severity) : ValidationSeverity.None; return((ValidationSeverity)Math.Max((int)issueMax, (int)reportMax)); }
public void CreateNewIssue() { var issueId = Issues.Any() ? Issues.Max(i => i.Id) + 1 : 1; var newIssue = new Issue(issueId) { Author = Environment.UserName, DateCreated = DateTime.Now, }; var issueVm = CreateIssueVm(newIssue); issueVm.IsLoaded = true; issueVm.IsDirty = true; Issues.Add(issueVm); ActiveIssue = issueVm; }