Пример #1
0
        public ServiceDTO Create(ServiceDTO modelDTO)
        {
            if (modelDTO != null)
            {
                return(ServiceAssembler.ToDTO(ServicesRepo.Create(ServiceAssembler.ToEntity(modelDTO))));
            }

            return(null);
        }
Пример #2
0
        public ServiceDTO Update(ServiceDTO modelDTO)
        {
            ServiceDTO returnService = null;

            if (modelDTO != null && modelDTO.ServiceID > 0)
            {
                ServicesRepo.Update(0, ServiceAssembler.ToEntity(modelDTO));
                returnService = modelDTO;
            }

            return(returnService);
        }
Пример #3
0
        public ServiceDTO Get(int id)
        {
            ServiceDTO oServiceDTO = null;

            if (id > 0)
            {
                Service oService = ServicesRepo.Get(id);
                if (oService != null)
                {
                    oServiceDTO = ServiceAssembler.ToDTO(oService);
                }
            }

            return(oServiceDTO);
        }
Пример #4
0
        public List <ServiceDTO> Get()
        {
            IEnumerable <Service> oService = ServicesRepo.Get();

            return(ServiceAssembler.ToDTOs(oService));
        }