예제 #1
0
        private async void button_AddMathService_Click(object sender, EventArgs e)
        {
            int number1 = int.Parse(textBox_MathServiceNumber1.Text);
            int number2 = int.Parse(textBox_MathServiceNumber2.Text);

            //var uri = new Uri("fabric:/SampleSFV2/MathService");
            ServiceProxyFactory proxyFactory = new ServiceProxyFactory((c) =>
            {
                FabricTransportRemotingSettings settings = new FabricTransportRemotingSettings();
                return(new FabricTransportServiceRemotingClientFactory(settings));
            });

            try
            {
                IMathCalculator service = proxyFactory.CreateServiceProxy <IMathCalculator>(_mathServiceUri, listenerName: "MathCalculator_v2");

                int result = await service.Add(number1, number2);

                MessageBox.Show("Result= " + result);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
예제 #2
0
 public MathService(StatelessServiceContext context)
     : base(context)
 {
     _mathCalculator_v2  = new MathCalculator();
     _textManipulator_v2 = new TextManipulator();
 }
 public MathCalculationsController(IMathCalculator mathCalculator)
 {
     this.mathCalculator = mathCalculator;
 }
 public MathCalculatorTestCustomFunction()
 {
     this.calculator = new MathCalculator();
 }
예제 #5
0
 public MathCalculatorTest()
 {
     this.calculator = new MathCalculator();
 }