public void SendMessage(SendMessageRequest request)
 {
     if (request.From != "System")
     {
         _serviceBus.PublishOneWay(new PublishRequest(typeof(IChatService), "SendMessage", new SendMessageRequest("System", request.From, request.To + " is an invalid user"),
             new MessageDeliveryContext(new KeyValuePair<MessageDeliveryContextKey, object>[] { new KeyValuePair<MessageDeliveryContextKey, object>(MessageDelivery.PrimaryIdentityNameKey, "SYSTEM") })));
     }
 }
 public void SendMessage(SendMessageRequest request)
 {
     if (ServiceSecurityContext.Current != null && ServiceSecurityContext.Current.PrimaryIdentity != null) Console.WriteLine("Identity: " + ServiceSecurityContext.Current.PrimaryIdentity.Name);
     Console.WriteLine(request.From + ": " + request.Message);
 }