Beispiel #1
0
        public void CloneCopiesAllTheProperties()
        {
            LogMessage item = CommonTestHelpers.Factory.CreateLogMessage();

            System.Threading.Thread.Sleep(100);

            LogMessage clone = item.Clone();

            Assert.AreEqual(JsonSerializer.Serialize(item), JsonSerializer.Serialize(clone));
        }
        public static async void ReportMessage(LogMessage message)
        {
            var g        = GlobalHost.ConnectionManager.GetHubContext <LoggingHub>();
            var clientId = message.Client.ClientId;
            var userId   = LookupUserId(message);

            message = message.Clone();
            //TODO: Prevent circular reference here
            message.Client.LogMessages = null;
            g.Clients.User(userId).newLogMessage(message);
        }