Class Message
Provides common details for protocol messages of any format.
Inheritance
Namespace:Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Contracts
Assembly:Microsoft.SqlTools.ServiceLayer.dll
Syntax
public class Message
Properties
| Improve this Doc View SourceContents
Gets or sets a JToken containing the contents of the message.
Declaration
public JToken Contents { get; set; }
Type | Description |
---|---|
Newtonsoft.Json.Linq.JToken |
Error
Gets or sets a JToken containing error details.
Declaration
public JToken Error { get; set; }
Type | Description |
---|---|
Newtonsoft.Json.Linq.JToken |
Id
Gets or sets the message's sequence ID.
Declaration
public string Id { get; set; }
Type | Description |
---|---|
System.String |
MessageType
Gets or sets the message type.
Declaration
public MessageType MessageType { get; set; }
Type | Description |
---|---|
MessageType |
Method
Gets or sets the message's method/command name.
Declaration
public string Method { get; set; }
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceEvent(String, JToken)
Creates a message with an Event type.
Declaration
public static Message Event(string method, JToken contents)
Parameters
Type | Name | Description |
---|---|---|
System.String | method | The method name of the event. |
Newtonsoft.Json.Linq.JToken | contents | The contents of the event. |
Returns
Type | Description |
---|---|
Message | A message with an Event type. |
Request(String, String, JToken)
Creates a message with a Request type.
Declaration
public static Message Request(string id, string method, JToken contents)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The sequence ID of the request. |
System.String | method | The method name of the request. |
Newtonsoft.Json.Linq.JToken | contents | The contents of the request. |
Returns
Type | Description |
---|---|
Message | A message with a Request type. |
Response(String, String, JToken)
Creates a message with a Response type.
Declaration
public static Message Response(string id, string method, JToken contents)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The sequence ID of the original request. |
System.String | method | The method name of the original request. |
Newtonsoft.Json.Linq.JToken | contents | The contents of the response. |
Returns
Type | Description |
---|---|
Message | A message with a Response type. |
ResponseError(String, String, JToken)
Creates a message with a Response type and error details.
Declaration
public static Message ResponseError(string id, string method, JToken error)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The sequence ID of the original request. |
System.String | method | The method name of the original request. |
Newtonsoft.Json.Linq.JToken | error | The error details of the response. |
Returns
Type | Description |
---|---|
Message | A message with a Response type and error details. |
Unknown()
Creates a message with an Unknown type.
Declaration
public static Message Unknown()
Returns
Type | Description |
---|---|
Message | A message with Unknown type. |