Ejemplo n.º 1
0
        /// <summary>
        /// This is the main entry point for your service replica.
        /// This method executes when this replica of your service becomes primary and has write status.
        /// </summary>
        /// <param name="cancellationToken">Canceled when Service Fabric needs to shut down this service replica.</param>
        protected override async Task RunAsync(CancellationToken cancellationToken)
        {
            // TODO: Replace the following sample code with your own logic
            //       or remove this RunAsync override if it's not needed in your service.

            var myDictionary = await this.StateManager.GetOrAddAsync <IReliableDictionary <string, long> >("myDictionary");

            try
            {
                var c1 = ServiceProxy.Create <IConsume>(new Uri("fabric:/TestEventHeredity/Producer"), new ServicePartitionKey(0));

                //var message =  await c1.ReadNameFromSource(new DataOriginal("Paperino", 15));
                var message2 = await c1.ReadNameFromSource(new DataOriginFirstBone("Pluto", 98, "- - - -"));

                var d2 = message2;
                d2 += "   d";
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     IMService helloWorldClient = ServiceProxy.Create <IMService>(new Uri("fabric:/MyApplication/Default.MService"));
 }