/// <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 }); }
/// <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 }); }