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());
            }
        }
 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();
 }
Beispiel #5
0
 public MathCalculatorTest()
 {
     this.calculator = new MathCalculator();
 }