Exemplo n.º 1
0
        public HttpResponseMessage GetConversion(ConversionRequestModel request, Int64 sourceid)
        {
            if (request == null)
            {
                return(Request.CreateResponse(System.Net.HttpStatusCode.BadRequest));
            }
            var source = TheSourceManager.GetSourceById(sourceid);

            if (source == null)
            {
                return(Request.CreateResponse(System.Net.HttpStatusCode.BadRequest));
            }
            if (!source.Active)
            {
                return(Request.CreateResponse(System.Net.HttpStatusCode.MethodNotAllowed));
            }
            var conversionService = _serviceLocator.GetServiceByName(source.Name);
            var response          = conversionService.Convert(TheModelFacctory.Parse(request));


            return(Request.CreateResponse(System.Net.HttpStatusCode.OK, TheModelFacctory.Create(response)));
        }
Exemplo n.º 2
0
 public XeGatewaySourceModel Get(int Sourceid)
 {
     return(TheModelFacctory.Create(TheSourceManager.GetSourceById(Sourceid)));
 }
Exemplo n.º 3
0
 public IEnumerable <XeGatewaySourceModel> Get()
 {
     return(TheSourceManager.GetSource().Select(m => TheModelFacctory.Create(m)));
 }