Esempio n. 1
0
        public static Service ToService(this ServiceV1DTO item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            Service service = new Service();

            service.CopyFromServiceV1DTO(item);
            return(service);
        }
Esempio n. 2
0
        public static ServiceV1DTO ToServiceV1DTO(this Service item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            ServiceV1DTO serviceV1DTO = new ServiceV1DTO();

            serviceV1DTO.CopyFromService(item);
            return(serviceV1DTO);
        }
Esempio n. 3
0
        public static void CopyFromService(this ServiceV1DTO to, Service from)
        {
            to.ServiceId             = from.ServiceId;
            to.ProgramId             = from.ProgramId;
            to.DepartmentId          = from.DepartmentId;
            to.DivisionId            = from.DivisionId;
            to.ServiceName           = from.ServiceName;
            to.ServiceDescription    = from.ServiceDescription;
            to.ExecutiveSummary      = from.ExecutiveSummary;
            to.ServiceArea           = from.ServiceArea;
            to.ContactId             = from.ContactId;
            to.EmployeeConnectMethod = from.EmployeeConnectMethod;
            to.CustomerConnectMethod = from.CustomerConnectMethod;
            to.ExpirationDate        = from.ExpirationDate;
            to.Active = from.Active;

            to.ContactDTO    = from.Contact?.ToContactV1DTO();
            to.DepartmentDTO = from.Department?.ToDepartmentV1DTO();
            to.DivisionDTO   = from.Division?.ToDivisionV1DTO();
            to.ProgramDTO    = from.Program?.ToProgramV1DTO();
        }