示例#1
0
 /// <summary>
 /// Convert to storage
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static WorkerDocument ToDocumentModel(this WorkerInfoModel model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new WorkerDocument {
         Id = model.AgentId,
         WorkerStatus = model.Status,
         LastSeen = model.LastSeen
     });
 }
示例#2
0
 /// <summary>
 /// Create model
 /// </summary>
 /// <param name="model"></param>
 public static WorkerInfoApiModel ToApiModel(
     this WorkerInfoModel model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new WorkerInfoApiModel {
         WorkerId = model.WorkerId,
         AgentId = model.AgentId,
         Status = (Api.Jobs.Models.WorkerStatus)model.Status,
         LastSeen = model.LastSeen
     });
 }