public override void Configure(Funq.Container container) { Plugins.Add(new RequestLogsFeature() { RequiredRoles = new string[] {} }); HttpServiceContainer.Build(container); }
public override void Configure(Container container) { //containers HttpServiceContainer.Build(container); SearchContainer.Build(container); // mappings AllergyMapper.Build(); GoalsMapper.Build(); AllergyMedSearchMapper.Build(); MedSuppMapper.Build(); PatientNoteMapper.Build(); PatientSystemMapper.Build(); PatientContactMapper.Build(); ContactTypeLookUpsMappers.Build(); ContactMapper.Build(); Plugins.Add(new RequestLogsFeature() { RequiredRoles = new string[] {} }); // request filtering for setting global vals. RequestFilters.Add((req, res, requestDto) => { HostContext.Instance.Items.Add("Contract", ((IAppDomainRequest)requestDto).ContractNumber); HostContext.Instance.Items.Add("Version", ((IAppDomainRequest)requestDto).Version); }); RequestFilters.Add((req, res, requestDto) => { var obj = req.ResponseContentType; }); var emitGlobalHeadersHandler = new CustomActionHandler((httpReq, httpRes) => httpRes.EndRequest()); SetConfig(new EndpointHostConfig { RawHttpHandlers = { (httpReq) => httpReq.HttpMethod == HttpMethods.Options ? emitGlobalHeadersHandler : null }, GlobalResponseHeaders = { //{"Access-Control-Allow-Origin", "*"}, { "Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS" }, { "Access-Control-Allow-Headers", "Content-Type" }, }, AllowJsonpRequests = true }); // initialize datetime format JsConfig.DateHandler = JsonDateHandler.ISO8601; }
public override void Configure(Funq.Container container) { Plugins.Add(new RequestLogsFeature() { RequiredRoles = new string[] {} }); HttpServiceContainer.Build(container); // request filtering for setting global vals. RequestFilters.Add((req, res, requestDto) => { HostContext.Instance.Items.Add("Contract", ((IDataDomainRequest)requestDto).ContractNumber.ToLower()); }); }