Пример #1
0
 public void AddMachine(ApiMachineResponseModel item)
 {
     if (!this.Machines.Any(x => x.Id == item.Id))
     {
         this.Machines.Add(item);
     }
 }
        public virtual ApiMachineRequestModel MapResponseToRequest(
            ApiMachineResponseModel response)
        {
            var request = new ApiMachineRequestModel();

            request.SetProperties(
                response.Description,
                response.JwtKey,
                response.LastIpAddress,
                response.MachineGuid,
                response.Name);
            return(request);
        }
        public virtual ApiMachineResponseModel MapRequestToResponse(
            int id,
            ApiMachineRequestModel request)
        {
            var response = new ApiMachineResponseModel();

            response.SetProperties(id,
                                   request.Description,
                                   request.JwtKey,
                                   request.LastIpAddress,
                                   request.MachineGuid,
                                   request.Name);
            return(response);
        }