title: Generate a workflow service programmatically
body: <p>I am working on an asp .net project which I develop a workflow service according to some selections of the user. When the user follow the appropriate steps it generates a flowchart. This flowchart is added to the body of a workflow service at the end with the following code.</p>
  
  <pre><code>          Flowchart flowchart = new Flowchart();
            flowchart = (Code to fill the flowchart)...
  
              Receive reserveSeat = new Receive();
  
              WorkflowService service = new WorkflowService()
          {
  
              Body = flowchart,
              Endpoints ={
              new Endpoint
              {
              ServiceContractName="IService",
              AddressUri = new Uri("http://localhost:2757"),
              Binding = new BasicHttpBinding(),
              }
  
              }
          };
  </code></pre>
  
  <p>Is there a way to add a Receive activity inside the body at the above code and not touch the flowchart?. I tried </p>
  
  <pre><code>Body = reserveSeat + flowchar, 
  </code></pre>
  
  <p>But is not working. Any ideas?</p>