You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/03/16 23:57:05 UTC
[GitHub] [pulsar] Anonymitaet commented on a change in pull request #9913: [docs] Fix installation instructions in c# documentation
Anonymitaet commented on a change in pull request #9913:
URL: https://github.com/apache/pulsar/pull/9913#discussion_r595617090
##########
File path: site2/docs/client-libraries-dotnet.md
##########
@@ -32,80 +32,35 @@ To install the Pulsar C# client library, following these steps:
4. Use `dotnet run` to test that the app has been created properly.
-2. Add the Newtonsoft.Json NuGet package.
+2. Add the DotPulsar NuGet package.
- 1. Use the following command to install the `Newtonsoft.json` package:
+ 1. Use the following command to install the `DotPulsar` package:
```
- dotnet add package Newtonsoft.Json
+ dotnet add package DotPulsar
```
2. After the command completes, open the `.csproj` file to see the added reference:
Review comment:
```suggestion
2. After the command completes, open the `.csproj` file to see the added reference.
```
##########
File path: site2/docs/client-libraries-dotnet.md
##########
@@ -32,80 +32,35 @@ To install the Pulsar C# client library, following these steps:
4. Use `dotnet run` to test that the app has been created properly.
-2. Add the Newtonsoft.Json NuGet package.
+2. Add the DotPulsar NuGet package.
- 1. Use the following command to install the `Newtonsoft.json` package:
+ 1. Use the following command to install the `DotPulsar` package:
```
- dotnet add package Newtonsoft.Json
+ dotnet add package DotPulsar
```
2. After the command completes, open the `.csproj` file to see the added reference:
```xml
<ItemGroup>
- <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
+ <PackageReference Include="DotPulsar" Version="0.11.0" />
</ItemGroup>
```
-3. Use the Newtonsoft.Json API in the app.
-
- 1. Open the `Program.cs` file and add the following line at the top of the file:
-
- ```c#
- using Newtonsoft.Json;
- ```
-
- 2. Add the following code before the `class Program` line:
-
- ```c#
- public class Account
- {
- public string Name { get; set; }
- public string Email { get; set; }
- public DateTime DOB { get; set; }
- }
- ```
-
- 3. Replace the `Main` function with the following:
-
- ```c#
- static void Main(string[] args)
- {
- Account account = new Account
- {
- Name = "John Doe",
- Email = "john@nuget.org",
- DOB = new DateTime(1980, 2, 20, 0, 0, 0, DateTimeKind.Utc),
- };
-
- string json = JsonConvert.SerializeObject(account, Formatting.Indented);
- Console.WriteLine(json);
- }
- ```
- 4. Build and run the app by using the `dotnet run` command. The output should be the JSON representation of the `Account` object in the code:
-
- ```output
- {
- "Name": "John Doe",
- "Email": "john@nuget.org",
- "DOB": "1980-02-20T00:00:00Z"
- }
- ```
-
## Client
This section describes some configuration examples for the Pulsar C# client.
### Create client
-This example shows how to create a Pulsar C# client connected to the local host.
+This example shows how to create a Pulsar C# client connected to localhost.
```c#
var client = PulsarClient.Builder().Build();
```
-To create a Pulsar C# client by using the builder, you need to specify the following options:
+To create a Pulsar C# client by using the builder, you can specify the following options:
Review comment:
```suggestion
To create a Pulsar C# client by using the builder, you can specify the following options.
```
##########
File path: site2/docs/client-libraries-dotnet.md
##########
@@ -32,80 +32,35 @@ To install the Pulsar C# client library, following these steps:
4. Use `dotnet run` to test that the app has been created properly.
-2. Add the Newtonsoft.Json NuGet package.
+2. Add the DotPulsar NuGet package.
- 1. Use the following command to install the `Newtonsoft.json` package:
+ 1. Use the following command to install the `DotPulsar` package:
Review comment:
```suggestion
1. Use the following command to install the `DotPulsar` package.
```
##########
File path: site2/docs/client-libraries-dotnet.md
##########
@@ -4,7 +4,7 @@ title: Pulsar C# client
sidebar_label: C#
---
-You can use the Pulsar C# client to create Pulsar producers and consumers in C#. All the methods in the producer, consumer, and reader of a C# client are thread-safe.
+You can use the Pulsar C# client (DotPulsar) to create Pulsar producers and consumers in C#. All the methods in the producer, consumer, and reader of a C# client are thread-safe. The official documentation for DotPulsar is available [here](https://github.com/apache/pulsar-dotpulsar/wiki)
Review comment:
```suggestion
You can use the Pulsar C# client (DotPulsar) to create Pulsar producers and consumers in C#. All the methods in the producer, consumer, and reader of a C# client are thread-safe. The official documentation for DotPulsar is available [here](https://github.com/apache/pulsar-dotpulsar/wiki).
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org