public ServiceDTO Create(ServiceDTO modelDTO) { if (modelDTO != null) { return(ServiceAssembler.ToDTO(ServicesRepo.Create(ServiceAssembler.ToEntity(modelDTO)))); } return(null); }
public ServiceDTO Update(ServiceDTO modelDTO) { ServiceDTO returnService = null; if (modelDTO != null && modelDTO.ServiceID > 0) { ServicesRepo.Update(0, ServiceAssembler.ToEntity(modelDTO)); returnService = modelDTO; } return(returnService); }
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); }
public List <ServiceDTO> Get() { IEnumerable <Service> oService = ServicesRepo.Get(); return(ServiceAssembler.ToDTOs(oService)); }