public ActionResult Index(FormPost post)
 {
     sbs.MakeTopic(post);
     sbs.MakeSubscription();
     ///sbs.MakeTopic(post);
     sbs.SaveSubscription(post);
     return View();
 }
        public void MakeTopic(FormPost post)
        {
            string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");

            var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);

            if (!namespaceManager.TopicExists("WebsiteMessages"))
            {
                namespaceManager.CreateTopic("WebsiteMessages");
            }

            TopicClient Client =
                TopicClient.CreateFromConnectionString(connectionString, "WebsiteMessages");

            BrokeredMessage message =
             new BrokeredMessage(post);
            message.Properties["FormType"] = post.FormType;
            Client.Send(message);
        }
 public void SaveSubscription(FormPost post)
 {
     repoForm.Insert(post);
     repoForm.SaveChanges();
 }