public PerformErrandResultViewModel(PerformErrandResult errandResult) { PerformingActorId = errandResult.PerformedErrand.ActorId; Errand = Enum.GetName(typeof(ErrandType), errandResult.PerformedErrand.Type).Replace('_', ' '); TerminatedActorId = errandResult.TerminatedActor?.Id; TerminatedActorName = errandResult.TerminatedActor?.Name; CompletedSuccessfully = errandResult.PerformedErrand.Status == ErrandStatus.Completed; ElapsedTime = errandResult.PerformedErrand.TimeToComplete; }
public PerformanceUpdateNotification(PerformErrandResult result) { PerformingActorId = result.PerformingActor.Id; ErrandSuccess = result.PerformedErrand.Status == ErrandStatus.Completed; NewKill = result.TerminatedActor != null; }
public Notification(string message, SeverityLevel severityLevel, PerformErrandResult result) : this(message, severityLevel) { Output = JsonConvert.SerializeObject(new PerformanceUpdateNotification(result)); OutputTyped = new PerformanceUpdateNotification(result); }