Ejemplo n.º 1
0
 /// <summary>
 /// Convert the <see cref="Job"/> to it's API form
 /// </summary>
 /// <returns>A new <see cref="Api.Models.Job"/></returns>
 public Api.Models.Job ToApi() => new Api.Models.Job
 {
     Id               = Id,
     StartedAt        = StartedAt,
     StoppedAt        = StoppedAt,
     Cancelled        = Cancelled,
     CancelledBy      = CancelledBy?.ToApi(false),
     CancelRight      = CancelRight,
     CancelRightsType = CancelRightsType,
     Description      = Description,
     ExceptionDetails = ExceptionDetails,
     StartedBy        = StartedBy.ToApi(false)
 };
Ejemplo n.º 2
0
 /// <inheritdoc />
 public JobResponse ToApi() => new JobResponse
 {
     Id               = Id,
     StartedAt        = StartedAt,
     StoppedAt        = StoppedAt,
     Cancelled        = Cancelled,
     CancelledBy      = CancelledBy?.CreateUserName(),
     CancelRight      = CancelRight,
     CancelRightsType = CancelRightsType,
     Description      = Description,
     ExceptionDetails = ExceptionDetails,
     ErrorCode        = ErrorCode,
     StartedBy        = StartedBy.CreateUserName(),
 };