Ejemplo n.º 1
0
 public void AddWorker(ApiWorkerResponseModel item)
 {
     if (!this.Workers.Any(x => x.Id == item.Id))
     {
         this.Workers.Add(item);
     }
 }
        public virtual ApiWorkerRequestModel MapResponseToRequest(
            ApiWorkerResponseModel response)
        {
            var request = new ApiWorkerRequestModel();

            request.SetProperties(
                response.CommunicationStyle,
                response.Fingerprint,
                response.IsDisabled,
                response.JSON,
                response.MachinePolicyId,
                response.Name,
                response.RelatedDocumentIds,
                response.Thumbprint,
                response.WorkerPoolIds);
            return(request);
        }
        public virtual ApiWorkerResponseModel MapRequestToResponse(
            string id,
            ApiWorkerRequestModel request)
        {
            var response = new ApiWorkerResponseModel();

            response.SetProperties(id,
                                   request.CommunicationStyle,
                                   request.Fingerprint,
                                   request.IsDisabled,
                                   request.JSON,
                                   request.MachinePolicyId,
                                   request.Name,
                                   request.RelatedDocumentIds,
                                   request.Thumbprint,
                                   request.WorkerPoolIds);
            return(response);
        }