public void Insert(InsertExposerDto dto) { Service servie = _serviceRepository.Get(dto.ServiceId); Exposer exposer = new Exposer(dto.Name, dto.Path, servie); _exposerRepository.Insert(exposer); }
public void UpdateExposer(ExposerDto dto) { Exposer exposer = _exposerRepository.Get(dto.Id); exposer.Name = dto.Name; exposer.Path = dto.Path; _exposerRepository.Update(exposer); }
public static ExposerDto ToDto(this Exposer entity) { if (entity == null) { return(null); } ExposerDto dto = new ExposerDto(); dto.Id = entity.Id; dto.Name = entity.Name; dto.Path = entity.Path; return(dto); }
public ExposerResultDto ExecuteExposer(ExecuteExposerDto dto) { Exposer exposer = _exposerRepository.GetByPath(dto.Path); if (exposer == null) { throw new ExposerDoesNotExistException(); } IList <Header> headers = new List <Header>(); foreach (var h in dto.Headers) { headers.Add(new Header(h.Name, h.Value)); } switch (exposer.Service.ServiceType) { case ServiceType.DUMMY: return(null); case ServiceType.REST: RestService restService = _jsonSerializer.Deserialize <RestService>(exposer.Service.JsonDetails); RestServiceRequest request = new RestServiceRequest(restService, dto.HttpMethod, headers, dto.RequestBody); RestServiceResponse response = _restServiceExecutor.Execute(request); return(response.ToDto()); case ServiceType.SOAP: return(null); case ServiceType.DATABASE: return(null); default: return(null); } }
public ExposerDto GetExposerById(ExposerIdDto dto) { Exposer exposer = _exposerRepository.Get(dto.Id); return(exposer.ToDto()); }
public static dynamic ExposeStatics(this Type target) { return(Exposer.ExposeStatics(target)); }
public static dynamic Expose(this object target) { return(Exposer.Expose(target)); }