public HttpResponseMessage Put(SomeParameters parameters)
        {
            // var job = this.service.DoJobAsync(parameters);
            var job = this.service.DoJob(parameters);

            return(Request.CreateResponse(job.Id));
        }
Ejemplo n.º 2
0
 public DoSomethingLoggedInRequiredOperation(
     SomeParameters parameters,
     IOperationsManager operationsManager,
     ISomeRequiredService requiredService)
     : base(parameters, operationsManager, requiredService)
 {
 }
 public DoSomethingOperation(
     SomeParameters parameters,
     IOperationsManager operationsManager,
     ISomeRequiredService someRequiredService)
     : base(operationsManager, "Do Something")
 {
     _parameters          = parameters;
     _someRequiredService = someRequiredService;
 }
Ejemplo n.º 4
0
        private static void UseProxyFactory(IProxyFactory <ITrialsService> proxyFactory)
        {
            Console.WriteLine("\n\nUsing {0} as IProxyFactory.", proxyFactory.GetType().GetGenericTypeDefinition().Name);
            Console.Write("Enter a number: ");
            int parameter;

            while (!int.TryParse(Console.ReadLine(), out parameter))
            {
                Console.Write("Please enter a valid integer: ");
            }
            var proxy      = proxyFactory.GetProxy();
            var parameters = new SomeParameters()
            {
                Parameter = parameter
            };
            var operationStatus = proxy.Execute(ch => ch.DoSomething(parameters));

            Console.WriteLine("Proxy operation result: {0}", operationStatus.Result);
            Console.Write("Press any key to continue...");
            Console.ReadKey();
        }
Ejemplo n.º 5
0
 private DoSomethingLoggedInRequiredOperation GetOperationDoSomethingLoggedInRequired(SomeParameters parameters)
 {
     return(new DoSomethingLoggedInRequiredOperation(parameters, _operationsManager, _requiredService));
 }
Ejemplo n.º 6
0
 public SomeResult DoSomethingLoggedInRequired(SomeParameters parameters)
 {
     return((SomeResult)DoOperation(GetOperationDoSomethingLoggedInRequired(parameters)).Result);
 }
Ejemplo n.º 7
0
 private DoSomethingOperation GetOperationDoSomething(SomeParameters parameters)
 {
     return(new DoSomethingOperation(parameters, _operationsManager, _someRequiredService));
 }
Ejemplo n.º 8
0
 public SomeResult DoSomething(SomeParameters parameters)
 {
     return((SomeResult)DoOperation(GetOperationDoSomething(parameters)).Result);
 }