Skip to content

Commit

Permalink
RavenDB-21980 : address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aviv committed Mar 5, 2024
1 parent cdd897f commit b83ca58
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,10 @@ namespace Raven.Client.Documents.Session
{
public partial interface IAsyncDocumentSession
{
/// <summary>
/// Advanced async session API for counter operations on a specific document
/// </summary>
/// <param name="documentId">The id of the document to operate on</param>
/// <inheritdoc cref="IDocumentSession.CountersFor(string)"/>
IAsyncSessionDocumentCounters CountersFor(string documentId);

/// <summary>
/// Advanced async session API for counter operations on a specific entity
/// </summary>
/// <param name="entity">The entity to operate on</param>
/// <inheritdoc cref="IDocumentSession.CountersFor(object)"/>
IAsyncSessionDocumentCounters CountersFor(object entity);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,16 @@

namespace Raven.Client.Documents.Session
{
/// <summary>
/// Provides async client API for counter operations on a specific entity
/// </summary>
/// <inheritdoc cref="ISessionDocumentCounters"/>
public interface IAsyncSessionDocumentCounters : ISessionDocumentCountersBase
{
/// <summary>
/// Get all counters for a specific document.
/// </summary>
///<returns>A Dictionary of counter values by counter name, containing all counters for this document</returns>
/// <inheritdoc cref="ISessionDocumentCounters.GetAll"/>
Task<Dictionary<string, long?>> GetAllAsync(CancellationToken token = default);

/// <summary>
/// Get counter value by counter name.
/// </summary>
///<param name="counter">Name of the counter to get</param>
/// <returns>The counter value if exists, or Null if the counter does not exist</returns>
/// <inheritdoc cref="ISessionDocumentCounters.Get(string)"/>
Task<long?> GetAsync(string counter, CancellationToken token = default);

/// <summary>
/// Get values of multiple counters of the same document
/// </summary>
/// <param name="counters">Names of the counters to get</param>
/// <returns>A dictionary of counter values by counter names</returns>
/// <inheritdoc cref="ISessionDocumentCounters.Get(IEnumerable{string})"/>
Task<Dictionary<string, long?>> GetAsync(IEnumerable<string> counters, CancellationToken token = default);

}
Expand Down
16 changes: 13 additions & 3 deletions src/Raven.Client/Documents/Session/ISessionDocumentCounters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,24 @@
namespace Raven.Client.Documents.Session
{
/// <summary>
/// Provides synchronous client API for counter operations on a specific entity
/// Provides client API for counter operations on a specific entity.<br/>
/// Counters are numeric data variables that can be added to documents,
/// and are used to perform high frequency counting in a distributed manner.<br/>
/// Read more about Counters <see href="https://ravendb.net/docs/article-page/6.0/csharp/document-extensions/counters/overview">here</see>
/// </summary>
public interface ISessionDocumentCounters : ISessionDocumentCountersBase
{
/// <inheritdoc cref="IAsyncSessionDocumentCounters.GetAllAsync"/>
/// <summary>
/// Get all counters for a specific document.
/// </summary>
///<returns>A Dictionary of counter values by counter name, containing all counters for this document</returns>
Dictionary<string, long?> GetAll();

/// <inheritdoc cref="IAsyncSessionDocumentCounters.GetAsync"/>
/// <summary>
/// Get counter value by counter name.
/// </summary>
///<param name="counter">Name of the counter to get</param>
/// <returns>The counter value if exists, or Null if the counter does not exist</returns>
long? Get(string counter);

/// <summary>
Expand Down

0 comments on commit b83ca58

Please sign in to comment.