Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(csharp): add guides #2695

Merged
merged 11 commits into from
Feb 16, 2024
Merged

docs(csharp): add guides #2695

merged 11 commits into from
Feb 16, 2024

Conversation

morganleroi
Copy link
Contributor

@morganleroi morganleroi commented Feb 11, 2024

🧭 What and Why

🎟 JIRA Ticket: DI-1812

Changes included:

  • Add all C# examples for all guides.

Copy link

netlify bot commented Feb 11, 2024

Deploy Preview for api-clients-automation ready!

Name Link
🔨 Latest commit 934f023
🔍 Latest deploy log https://app.netlify.com/sites/api-clients-automation/deploys/65cf75d6692d2f0009598684
😎 Deploy Preview https://deploy-preview-2695--api-clients-automation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@algolia-bot
Copy link
Collaborator

algolia-bot commented Feb 11, 2024

✗ The generated branch has been deleted.

If the PR has been merged, you can check the generated code on the main branch.
You can still access the code generated on main via this commit.

@morganleroi morganleroi changed the title doc(csharp): add guides docs(csharp): add guides Feb 12, 2024
@morganleroi morganleroi marked this pull request as ready for review February 14, 2024 15:01
@morganleroi morganleroi requested a review from a team as a code owner February 14, 2024 15:01
Copy link
Collaborator

@millotp millotp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the content is really good !
My only remark is about indentation, I didn't spot everything but it shows up in docusaurus, so it would be nice to have consistent indents

var client = new SearchClient("<YOUR_APP_ID>", "<YOUR_API_KEY>");
await client.SetSettingsAsync("YOUR_INDEX_NAME", new IndexSettings {
AttributesForFaceting = new List<string> { "actor", "filterOnly(category)", "searchable(publisher)" }
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
});
});

var client = new SearchClient("<YOUR_APP_ID>", "<YOUR_API_KEY>");

client.Search<Hit>(new SearchMethodParams(new List<SearchQuery>
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this indentation is a bit messed up here

</TabItem>
<TabItem value="csharp">

```csharp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove the spaces here and at the end pls ?


<TabItem value="csharp" >

```csharp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

If you are using the .NET CLI, you can install the package using the following command:

```bash
dotnet add package Algolia.Search --version [The version you want to install]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually we have <> for required parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what you mean.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<The version you want to install>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh okay understood

using Algolia.Search.Utils;

var response = await client.SaveObjectAsync("<YOUR_INDEX_NAME>",
new { firstName = "john", lastname = "doe" });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
new { firstName = "john", lastname = "doe" });
new { firstName = "john", lastname = "doe" });


public class Actor : Hit
{
[DataMember(Name = "name")]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It's the way we tell the serializer that we want to serialize the field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I have an issue. Dam.


<TabItem value="csharp">

```csharp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces

Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing to add it looks pretty nice!

there seems to be some spacing issue, maybe copy all your examples in the playground and format them, the re-copy them in the doc?

@morganleroi morganleroi self-assigned this Feb 16, 2024
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonderful!


<TabItem value="csharp">

> Create your own requester by creating a class that implements `IHttpRequester`, and use it by passing it to the client constructor.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> Create your own requester by creating a class that implements `IHttpRequester`, and use it by passing it to the client constructor.
> Create your own requester by creating a class that implements `IHttpRequester`, and use it by passing it to the client constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch !

millotp
millotp previously approved these changes Feb 16, 2024
@morganleroi morganleroi enabled auto-merge (squash) February 16, 2024 15:06
@morganleroi morganleroi merged commit 0bafedc into main Feb 16, 2024
14 checks passed
@morganleroi morganleroi deleted the doc/csharp-guides branch February 16, 2024 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants