<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>NRedisStack guide (C#/.NET) on Docs</title>
    <link>https://redis.io/docs/latest/develop/clients/dotnet/</link>
    <description>Recent content in NRedisStack guide (C#/.NET) on Docs</description>
    <generator>Hugo</generator>
    <language>en</language>
    <atom:link href="https://redis.io/docs/latest/develop/clients/dotnet/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Connect to the server</title>
      <link>https://redis.io/docs/latest/develop/clients/dotnet/connect/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/dotnet/connect/</guid>
      <description>&lt;h2 id=&#34;basic-connection&#34; class=&#34;group relative&#34;&gt;&#xA;  Basic connection&#xA;  &lt;a href=&#34;#basic-connection&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;You can connect to the server simply by passing a string of the&#xA;form &amp;quot;hostname:port&amp;quot; to the &lt;code&gt;Connect()&lt;/code&gt; method (for example,&#xA;&amp;quot;localhost:6379&amp;quot;). However, you can also connect using a&#xA;&lt;code&gt;ConfigurationOptions&lt;/code&gt; parameter. Use this to specify a&#xA;username, password, and many other options:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Index and query documents</title>
      <link>https://redis.io/docs/latest/develop/clients/dotnet/queryjson/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/dotnet/queryjson/</guid>
      <description>&lt;p&gt;This example shows how to create a&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/indexing/&#34;&gt;search index&lt;/a&gt;&#xA;for &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/json/&#34;&gt;JSON&lt;/a&gt; documents and&#xA;run queries against the index. It then goes on to show the slight differences&#xA;in the equivalent code for &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/hashes/&#34;&gt;hash&lt;/a&gt;&#xA;documents.&lt;/p&gt;&#xA;&#xA;&lt;div class=&#34;alert p-3 relative flex flex-row flex-wrap items-center text-base bg-redis-pencil-200 rounded-md&#34;&gt;&#xA;  &lt;div class=&#34;p-2 pr-5&#34;&gt;&lt;svg width=&#34;21&#34; height=&#34;21&#34; viewBox=&#34;0 0 21 21&#34; fill=&#34;none&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;  &lt;circle cx=&#34;10.5&#34; cy=&#34;10.5&#34; r=&#34;9.75&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;1.5&#34;/&gt;&#xA;  &lt;path d=&#34;M10.5 14V16&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34;/&gt;&#xA;  &lt;path d=&#34;M10.5 5V12&#34; stroke=&#34;currentColor&#34; stroke-width=&#34;2&#34;/&gt;&#xA;&lt;/svg&gt;&#xA;  &lt;/div&gt;&#xA;  &lt;div class=&#34;p-1 pl-4 sm:pl-6 border-l border-l-redis-ink-900 border-opacity-50 flex-1&#34;&gt;&#xA;  &#xA;  &lt;div class=&#34;font-medium&#34;&gt;Note:&lt;/div&gt;&#xA;  From &lt;a href=&#34;https://github.com/redis/NRedisStack/releases/tag/v1.0.0&#34;&gt;v1.0.0&lt;/a&gt;&#xA;onwards, &lt;code&gt;NRedisStack&lt;/code&gt; uses query dialect 2 by default.&#xA;Redis query engine methods such as &lt;a href=&#34;https://redis.io/docs/latest/commands/ft.search/&#34;&gt;&lt;code&gt;FT().Search()&lt;/code&gt;&lt;/a&gt;&#xA;will explicitly request this dialect, overriding the default set for the server.&#xA;See&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/advanced-concepts/dialects/&#34;&gt;Query dialects&lt;/a&gt;&#xA;for more information.&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&lt;h2 id=&#34;initialize&#34; class=&#34;group relative&#34;&gt;&#xA;  Initialize&#xA;  &lt;a href=&#34;#initialize&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Make sure that you have &lt;a href=&#34;https://redis.io/docs/latest/operate/oss_and_stack/&#34;&gt;Redis Open Source&lt;/a&gt;&#xA;or another Redis server available. Also install the&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/clients/dotnet/&#34;&gt;&lt;code&gt;NRedisStack&lt;/code&gt;&lt;/a&gt; client library if you&#xA;haven&#39;t already done so.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Index and query vectors</title>
      <link>https://redis.io/docs/latest/develop/clients/dotnet/vecsearch/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/dotnet/vecsearch/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/&#34;&gt;Redis Query Engine&lt;/a&gt;&#xA;lets you index vector fields in &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/hashes/&#34;&gt;hash&lt;/a&gt;&#xA;or &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/json/&#34;&gt;JSON&lt;/a&gt; objects (see the&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/vectors/&#34;&gt;Vectors&lt;/a&gt;&#xA;reference page for more information).&#xA;Among other things, vector fields can store &lt;em&gt;text embeddings&lt;/em&gt;, which are AI-generated vector&#xA;representations of the semantic information in pieces of text. The&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/search-and-query/vectors/#distance-metrics&#34;&gt;vector distance&lt;/a&gt;&#xA;between two embeddings indicates how similar they are semantically. By comparing the&#xA;similarity of an embedding generated from some query text with embeddings stored in hash&#xA;or JSON fields, Redis can retrieve documents that closely match the query in terms&#xA;of their meaning.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Vector set embeddings</title>
      <link>https://redis.io/docs/latest/develop/clients/dotnet/vecsets/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/dotnet/vecsets/</guid>
      <description>&lt;p&gt;A Redis &lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/vector-sets/&#34;&gt;vector set&lt;/a&gt; lets&#xA;you store a set of unique keys, each with its own associated vector.&#xA;You can then retrieve keys from the set according to the similarity between&#xA;their stored vectors and a query vector that you specify.&lt;/p&gt;&#xA;&lt;p&gt;You can use vector sets to store any type of numeric vector but they are&#xA;particularly optimized to work with text embedding vectors (see&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/ai/&#34;&gt;Redis for AI&lt;/a&gt; to learn more about text&#xA;embeddings). The example below shows how to use the&#xA;&lt;a href=&#34;https://dotnet.microsoft.com/en-us/apps/ai/ml-dotnet&#34;&gt;&lt;code&gt;Microsoft.ML&lt;/code&gt;&lt;/a&gt;&#xA;library to generate vector embeddings and then&#xA;store and retrieve them using a vector set with &lt;code&gt;StackExchange.Redis&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Probabilistic data types</title>
      <link>https://redis.io/docs/latest/develop/clients/dotnet/prob/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/dotnet/prob/</guid>
      <description>&lt;p&gt;Redis supports several&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/data-types/probabilistic/&#34;&gt;probabilistic data types&lt;/a&gt;&#xA;that let you calculate values approximately rather than exactly.&#xA;The types fall into two basic categories:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#set-operations&#34;&gt;Set operations&lt;/a&gt;: These types let you calculate (approximately)&#xA;the number of items in a set of distinct values, and whether or not a given value is&#xA;a member of a set.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;#statistics&#34;&gt;Statistics&lt;/a&gt;: These types give you an approximation of&#xA;statistics such as the quantiles, ranks, and frequencies of numeric data points in&#xA;a list.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;To see why these approximate calculations would be useful, consider the task of&#xA;counting the number of distinct IP addresses that access a website in one day.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Pipelines and transactions</title>
      <link>https://redis.io/docs/latest/develop/clients/dotnet/transpipe/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/dotnet/transpipe/</guid>
      <description>&lt;p&gt;Redis lets you send a sequence of commands to the server together in a batch.&#xA;There are two types of batch that you can use:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Pipelines&lt;/strong&gt; avoid network and processing overhead by sending several commands&#xA;to the server together in a single communication. The server then sends back&#xA;a single communication with all the responses. See the&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/using-commands/pipelining/&#34;&gt;Pipelining&lt;/a&gt; page for more&#xA;information.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Transactions&lt;/strong&gt; guarantee that all the included commands will execute&#xA;to completion without being interrupted by commands from other clients.&#xA;See the &lt;a href=&#34;https://redis.io/docs/latest/develop/using-commands/transactions/&#34;&gt;Transactions&lt;/a&gt;&#xA;page for more information.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;execute-a-pipeline&#34; class=&#34;group relative&#34;&gt;&#xA;  Execute a pipeline&#xA;  &lt;a href=&#34;#execute-a-pipeline&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;To execute commands in a pipeline, you first create a pipeline object&#xA;and then add commands to it using methods that resemble the &lt;em&gt;asynchronous&lt;/em&gt;&#xA;versions of the standard command methods&#xA;(for example, &lt;code&gt;StringSetAsync()&lt;/code&gt; and &lt;code&gt;StringGetAsync()&lt;/code&gt;). The commands are&#xA;buffered in the pipeline and only execute when you call the &lt;code&gt;Execute()&lt;/code&gt;&#xA;method on the pipeline object.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Conditional execution</title>
      <link>https://redis.io/docs/latest/develop/clients/dotnet/condexec/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/dotnet/condexec/</guid>
      <description>&lt;p&gt;Most Redis client libraries use transactions with the&#xA;&lt;a href=&#34;https://redis.io/docs/latest/commands/watch/&#34;&gt;&lt;code&gt;WATCH&lt;/code&gt;&lt;/a&gt; command as the main way to prevent&#xA;two clients writing to the same key at once (see &lt;a href=&#34;https://redis.io/docs/latest/develop/using-commands/transactions/&#34;&gt;Transactions&lt;/a&gt; for more information). Unfortunately, this approach is&#xA;difficult to use explicitly in &lt;code&gt;NRedisStack&lt;/code&gt;. Its&#xA;&lt;a href=&#34;https://redis.io/docs/latest/develop/clients/pools-and-muxing/&#34;&gt;multiplexing&lt;/a&gt; system&#xA;is highly efficient and convenient but can also cause bad interactions&#xA;when different connections use watched transactions at the same time.&lt;/p&gt;&#xA;&lt;p&gt;Instead, &lt;code&gt;NRedisStack&lt;/code&gt; relies more heavily on conditional execution. This comes&#xA;in two basic forms, &lt;code&gt;When&lt;/code&gt; conditions and transaction conditions, both of which&#xA;are explained in the sections below.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Error handling</title>
      <link>https://redis.io/docs/latest/develop/clients/dotnet/error-handling/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/dotnet/error-handling/</guid>
      <description>&lt;p&gt;NRedisStack uses &lt;strong&gt;exceptions&lt;/strong&gt; to signal errors. Code examples in the documentation often omit error handling for brevity, but it is essential in production code. This page explains how NRedisStack&#39;s error handling works and how to apply common error handling patterns.&lt;/p&gt;&#xA;&lt;p&gt;For an overview of error types and handling strategies, see &lt;a href=&#34;https://redis.io/docs/latest/develop/clients/error-handling/&#34;&gt;Error handling&lt;/a&gt;.&#xA;See also &lt;a href=&#34;https://redis.io/docs/latest/develop/clients/dotnet/produsage/&#34;&gt;Production usage&lt;/a&gt;&#xA;for more information on connection management, timeouts, and other aspects of&#xA;app reliability.&lt;/p&gt;&#xA;&lt;h2 id=&#34;exception-types&#34; class=&#34;group relative&#34;&gt;&#xA;  Exception types&#xA;  &lt;a href=&#34;#exception-types&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;NRedisStack throws exceptions to signal errors. Common exception types include:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Production usage</title>
      <link>https://redis.io/docs/latest/develop/clients/dotnet/produsage/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://redis.io/docs/latest/develop/clients/dotnet/produsage/</guid>
      <description>&lt;p&gt;This guide offers recommendations to get the best reliability and&#xA;performance in your production environment.&lt;/p&gt;&#xA;&lt;h2 id=&#34;checklist&#34; class=&#34;group relative&#34;&gt;&#xA;  Checklist&#xA;  &lt;a href=&#34;#checklist&#34; class=&#34;header-link opacity-0 group-hover:opacity-100 transition-opacity duration-200 ml-1 align-baseline&#34; aria-label=&#34;Link to this section&#34; title=&#34;Copy link to clipboard&#34;&gt;&#xA;    &lt;svg class=&#34;inline-block w-4 h-4 align-baseline&#34; fill=&#34;currentColor&#34; viewBox=&#34;0 0 20 20&#34; xmlns=&#34;http://www.w3.org/2000/svg&#34;&gt;&#xA;      &lt;path fill-rule=&#34;evenodd&#34; d=&#34;M12.586 4.586a2 2 0 112.828 2.828l-3 3a2 2 0 01-2.828 0 1 1 0 00-1.414 1.414 4 4 0 005.656 0l3-3a4 4 0 00-5.656-5.656l-1.5 1.5a1 1 0 101.414 1.414l1.5-1.5zm-5 5a2 2 0 012.828 0 1 1 0 101.414-1.414 4 4 0 00-5.656 0l-3 3a4 4 0 105.656 5.656l1.5-1.5a1 1 0 10-1.414-1.414l-1.5 1.5a2 2 0 11-2.828-2.828l3-3z&#34; clip-rule=&#34;evenodd&#34;&gt;&lt;/path&gt;&#xA;    &lt;/svg&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Each item in the checklist below links to the section&#xA;for a recommendation. Use the checklist icons to record your&#xA;progress in implementing the recommendations.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
