CQRSMicroservices.ServiceFabric.AggregateRootActor.Program.Main C# (CSharp) Method

Main() private static method

This is the entry point of the service host process.
private static Main ( ) : void
return void
    private static void Main()
    {
      try
      {
        // Creating a FabricRuntime connects this host process to the Service Fabric runtime on this node.
        using(FabricRuntime fabricRuntime = FabricRuntime.Create())
        {
          CqrsApplication.SetService<IDeserializer>(new Deserializer());

          // This line registers your actor class with the Fabric Runtime.
          // The contents of your ServiceManifest.xml and ApplicationManifest.xml files
          // are automatically populated when you build this project.
          // For information, see http://aka.ms/servicefabricactorsplatform
          fabricRuntime.RegisterActor<AggregateRootActor>();

          Thread.Sleep(Timeout.Infinite);  // Prevents this host process from terminating so services keeps running.
        }
      }
      catch(Exception e)
      {
        ActorEventSource.Current.ActorHostInitializationFailed(e.ToString());
        throw;
      }
    }
  }
Program