コード例 #1
0
ファイル: Program.cs プロジェクト: apibridge/ApiBridge
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to ApiBridge Service Console!");

            Initialize();

            // wait to initialize
            Thread.Sleep(5000);
            Console.WriteLine("Ready...");

            while (true)
            {
                Comment myComment = new Comment();
                myComment.Text = "My Comment: " + Console.ReadLine();

                CommentEvent commentEvent = new CommentEvent();
                commentEvent.Comment = myComment;

                BusConfiguration.Instance.Bus.PublishAsync<CommentEvent>(commentEvent, (result) =>
                {
                    Console.WriteLine("Sent:" + result.IsSuccess);
                });
            }
        }
コード例 #2
0
        /// <summary>
        /// Syndicates the comment event.
        /// </summary>
        /// <param name="comment">The comment.</param>
        void PublicCommentEvent(Comment comment)
        {
            try
            {
                CommentEvent newCommentEvent = new CommentEvent();
                newCommentEvent.Comment = comment;

                BaseController.ServiceBus.PublishAsync<CommentEvent>(newCommentEvent, (result) => { });
            }
            catch
            {

            }
        }
コード例 #3
0
 public void Save(Comment comment)
 {
     session.Store(comment);
     session.SaveChanges();
 }