diff --git a/src/Raven.Client/Documents/Operations/Counters/CounterBatch.cs b/src/Raven.Client/Documents/Operations/Counters/CounterBatch.cs index 31bf4e83f434..50ff77a5db76 100644 --- a/src/Raven.Client/Documents/Operations/Counters/CounterBatch.cs +++ b/src/Raven.Client/Documents/Operations/Counters/CounterBatch.cs @@ -7,6 +7,9 @@ namespace Raven.Client.Documents.Operations.Counters { + /// + /// Represents a batch of counter operations on multiple documents, supporting retrieval of counter values across nodes. + /// public sealed class CounterBatch { public bool ReplyWithAllNodesValues; @@ -14,6 +17,9 @@ public sealed class CounterBatch public bool FromEtl; } + /// + /// Represents counter operations for a specific document, such as increment or set operations on named counters. + /// public sealed class DocumentCountersOperation { public List Operations; @@ -82,6 +88,9 @@ public enum CounterOperationType GetAll } + /// + /// Represents a single counter operation, which defines actions such as incrementing a counter value ,deleting a counter or retrieving a counter value for a specific document and counter name. + /// public sealed class CounterOperation { public CounterOperationType Type; diff --git a/src/Raven.Client/Documents/Operations/Counters/CounterBatchOperation.cs b/src/Raven.Client/Documents/Operations/Counters/CounterBatchOperation.cs index 2119e6e58578..f6d3907a0dd9 100644 --- a/src/Raven.Client/Documents/Operations/Counters/CounterBatchOperation.cs +++ b/src/Raven.Client/Documents/Operations/Counters/CounterBatchOperation.cs @@ -12,6 +12,10 @@ public sealed class CounterBatchOperation : IOperation { private readonly CounterBatch _counterBatch; + /// + /// Initializes a new instance of the class with the specified counter batch. + /// + /// The batch of counter operations to be processed. public CounterBatchOperation(CounterBatch counterBatch) { _counterBatch = counterBatch; diff --git a/src/Raven.Client/Documents/Operations/Counters/GetCountersOperation.cs b/src/Raven.Client/Documents/Operations/Counters/GetCountersOperation.cs index 4f7ef2a814d2..2a21cca8e800 100644 --- a/src/Raven.Client/Documents/Operations/Counters/GetCountersOperation.cs +++ b/src/Raven.Client/Documents/Operations/Counters/GetCountersOperation.cs @@ -16,6 +16,13 @@ public sealed class GetCountersOperation : IOperation private readonly string[] _counters; private readonly bool _returnFullResults; + /// + /// Initializes a new instance of the class with a specific document ID, + /// an array of counter names, and a flag indicating whether to include counter values from each node in the result. + /// + /// The ID of the document for which to retrieve counters. + /// An array of counter names to retrieve. + /// A value indicating whether the result should include counter values from each node. public GetCountersOperation(string docId, string[] counters, bool returnFullResults = false) { _docId = docId; @@ -23,6 +30,12 @@ public GetCountersOperation(string docId, string[] counters, bool returnFullResu _returnFullResults = returnFullResults; } + /// + /// Initializes a new instance of the class with a specific document ID + /// and a single counter name, along with a flag indicating whether to include counter values from each node in the result. + /// + /// + /// The name of the counter to retrieve. public GetCountersOperation(string docId, string counter, bool returnFullResults = false) { _docId = docId; @@ -30,6 +43,12 @@ public GetCountersOperation(string docId, string counter, bool returnFullResults _returnFullResults = returnFullResults; } + /// + /// Initializes a new instance of the class with a specific document ID + /// and a flag indicating whether to include counter values from each node in the result. + /// This operation retrieves all counters associated with the given document. + /// + /// public GetCountersOperation(string docId, bool returnFullResults = false) { _docId = docId; diff --git a/src/Raven.Client/Documents/Operations/TimeSeries/GetMultipleTimeSeriesOperation.cs b/src/Raven.Client/Documents/Operations/TimeSeries/GetMultipleTimeSeriesOperation.cs index a0c6059ae9f0..d9cda3e1d467 100644 --- a/src/Raven.Client/Documents/Operations/TimeSeries/GetMultipleTimeSeriesOperation.cs +++ b/src/Raven.Client/Documents/Operations/TimeSeries/GetMultipleTimeSeriesOperation.cs @@ -21,6 +21,18 @@ public sealed class GetMultipleTimeSeriesOperation : IOperation _includes; private readonly bool _returnFullResults; + /// + /// Initializes a new instance of the class, + /// retrieving entries from multiple time series associated with a document across specified ranges. + /// + /// The ID of the document for which time series entries are requested. + /// + /// A collection of objects, each specifying a time series name + /// and a date range (from and to) to retrieve entries from. + /// + /// The start index for pagination of results. + /// The number of entries to retrieve. Defaults to int.MaxValue for all entries. + /// Whether to include detailed information for each entry. If false, retrieves only basic information. public GetMultipleTimeSeriesOperation(string docId, IEnumerable ranges, int start = 0, int pageSize = int.MaxValue, bool returnFullResults = false) : this(docId, ranges, start, pageSize, includes: null, returnFullResults) { diff --git a/src/Raven.Client/Documents/Operations/TimeSeries/GetTimeSeriesOperation.cs b/src/Raven.Client/Documents/Operations/TimeSeries/GetTimeSeriesOperation.cs index 3e602f1bc97b..7ab898452c94 100644 --- a/src/Raven.Client/Documents/Operations/TimeSeries/GetTimeSeriesOperation.cs +++ b/src/Raven.Client/Documents/Operations/TimeSeries/GetTimeSeriesOperation.cs @@ -14,11 +14,17 @@ namespace Raven.Client.Documents.Operations.TimeSeries { public sealed class GetTimeSeriesOperation : GetTimeSeriesOperation { + /// + /// Initializes a new instance of the class, + /// retrieving multiple entries from a time series associated with a document within a specified date range. + /// + /// public GetTimeSeriesOperation(string docId, string timeseries, DateTime? @from = null, DateTime? to = null, int start = 0, int pageSize = int.MaxValue, bool returnFullResults = false) : base(docId, timeseries, @from, to, start, pageSize, returnFullResults) { } } + public class GetTimeSeriesOperation : IOperation> where TValues : TimeSeriesEntry { private readonly string _docId, _name; @@ -27,6 +33,21 @@ public class GetTimeSeriesOperation : IOperation _includes; private readonly bool _returnFullResults; + /// + /// Initializes a new instance of the class, + /// retrieving multiple entries from a time series associated with a document within a specified date range. + /// + /// + /// The type to which each time series entry should be projected. + /// Must be a subtype of . + /// + /// The ID of the document that holds the time series. + /// The name of the time series to retrieve. + /// The start date of the range from which entries should be retrieved. If null, retrieval begins from the earliest entry. + /// The end date of the range up to which entries should be retrieved. If null, retrieval continues to the latest entry. + /// The start index for pagination of results. + /// The number of entries to retrieve. Defaults to int.MaxValue for retrieving all entries within the specified range. + /// Whether to include detailed information for each entry. If false, retrieves only basic information. public GetTimeSeriesOperation(string docId, string timeseries, DateTime? from = null, DateTime? to = null, int start = 0, int pageSize = int.MaxValue, bool returnFullResults = false) : this(docId, timeseries, from, to, start, pageSize, includes: null, returnFullResults) { } diff --git a/src/Raven.Client/Documents/Operations/TimeSeries/TimeSeriesBatchOperation.cs b/src/Raven.Client/Documents/Operations/TimeSeries/TimeSeriesBatchOperation.cs index 94227c855465..72a43ee7cda0 100644 --- a/src/Raven.Client/Documents/Operations/TimeSeries/TimeSeriesBatchOperation.cs +++ b/src/Raven.Client/Documents/Operations/TimeSeries/TimeSeriesBatchOperation.cs @@ -12,6 +12,12 @@ public sealed class TimeSeriesBatchOperation : IOperation private readonly string _documentId; private readonly TimeSeriesOperation _operation; + /// + /// Initializes a new instance of the class, + /// performing batch operations on a time series, including appending or deleting entries. + /// + /// The ID of the document that holds the time series. + /// The batch of time series operations to be applied. public TimeSeriesBatchOperation(string documentId, TimeSeriesOperation operation) { _documentId = documentId ?? throw new ArgumentNullException(nameof(documentId)); diff --git a/src/Raven.Client/Documents/Operations/TimeSeries/TimeSeriesOperation.cs b/src/Raven.Client/Documents/Operations/TimeSeries/TimeSeriesOperation.cs index be11b45c7cbe..951f3a585fec 100644 --- a/src/Raven.Client/Documents/Operations/TimeSeries/TimeSeriesOperation.cs +++ b/src/Raven.Client/Documents/Operations/TimeSeries/TimeSeriesOperation.cs @@ -8,6 +8,10 @@ namespace Raven.Client.Documents.Operations.TimeSeries { + /// + /// Represents a batch operation for time series data, including appends, increments, and deletions, + /// to be performed on a single document’s time series. + /// public sealed class TimeSeriesOperation { private SortedList _appends; @@ -291,6 +295,9 @@ public DynamicJsonValue ToJson() }; } + /// + /// Represents an append operation in a time series, allowing new data points to be added at specific timestamps. + /// public sealed class AppendOperation { public DateTime Timestamp; @@ -338,6 +345,9 @@ public DynamicJsonValue ToJson() } } + /// + /// Represents a delete operation in a time series, allowing data points within a specific range to be removed. + /// public sealed class DeleteOperation { public DateTime? From, To; @@ -364,6 +374,9 @@ public DynamicJsonValue ToJson() } } + /// + /// Represents an increment operation in a time series, allowing values at a specific timestamp to be incremented. + /// public sealed class IncrementOperation { public DateTime Timestamp; diff --git a/src/Raven.Client/Documents/Session/Loaders/IncludeBuilder.cs b/src/Raven.Client/Documents/Session/Loaders/IncludeBuilder.cs index 0f91b731cd1e..d1543d588153 100644 --- a/src/Raven.Client/Documents/Session/Loaders/IncludeBuilder.cs +++ b/src/Raven.Client/Documents/Session/Loaders/IncludeBuilder.cs @@ -115,10 +115,36 @@ public interface IAbstractTimeSeriesIncludeBuilder TBuilder IncludeAllTimeSeries(TimeSeriesRangeType type, int count); } + /// + /// The server is instructed to include revisions of the specified documents when retrieving them.
+ /// Once loaded into the session, revisions can be accessed without additional server requests, ensuring efficient + /// retrieval of document history. + ///
public interface IRevisionIncludeBuilder { + /// + /// Include a single revision by specifying the path to the document property that contains the revision's change vector. + /// Each time a document is modified, its change vector is updated. By storing the change vector in a dedicated + /// property, you can easily include revisions when the document is loaded. + /// + /// An expression indicating the property path containing the revision change vector. TBuilder IncludeRevisions(Expression> path); + + /// + /// Include multiple revisions by specifying the path to the document property that contains an array of change vectors. + /// When modifications are made to the document, the updated change vectors can be stored, allowing you to easily + /// include multiple revisions when the document is loaded. + /// + /// An expression indicating the property path containing the revision change vectors. TBuilder IncludeRevisions(Expression>> path); + + /// + /// Include a single revision by specifying its creation time. + /// The specified time can be in local time or UTC; the server will convert it to UTC. + /// If an exact match for the creation time is found, that revision will be included. + /// Otherwise, the first revision preceding the specified time will be returned. + /// + /// The creation time of the revision to include. TBuilder IncludeRevisions(DateTime before); } @@ -137,16 +163,46 @@ public interface ISubscriptionTimeSeriesIncludeBuilder : IAbstr { } + /// + /// The server is instructed to include Compare Exchange values when retrieving documents.
+ /// Compare Exchange items can be included both when loading entities and during query execution. + /// The session automatically tracks the included Compare Exchange items, allowing their values + /// to be accessed without making additional calls to the server. + ///
public interface ICompareExchangeValueIncludeBuilder { + /// + /// Include a single Compare Exchange value by specifying its key. + /// The key should correspond to the Compare Exchange item you wish to include. + /// + /// The key of the Compare Exchange value to include. TBuilder IncludeCompareExchangeValue(string path); + /// + /// Include a single Compare Exchange value by specifying a path to the key. + /// This allows for dynamic resolution of the Compare Exchange key based on + /// the document's properties. + /// + /// An expression indicating the property path that resolves to the Compare Exchange key. TBuilder IncludeCompareExchangeValue(Expression> path); + /// + /// Include multiple Compare Exchange values by specifying a path to a collection of keys. + /// This allows for the inclusion of multiple Compare Exchange items in a single call. + /// + /// An expression indicating the property path that resolves to an array of Compare Exchange keys. TBuilder IncludeCompareExchangeValue(Expression>> path); } + /// + /// The server is instructed to include various types of related items when retrieving documents.
+ /// The items are added to the session unit of work, and subsequent requests to load them are served directly from the session cache, + /// without requiring any additional queries to the server. + /// This interface combines functionalities for including documents, counters, time series, compare exchange values, and revisions. + ///
+ /// The type of the document being built. + /// The type of the builder being used. public interface IIncludeBuilder : IDocumentIncludeBuilder, ICounterIncludeBuilder, ITimeSeriesIncludeBuilder, ICompareExchangeValueIncludeBuilder, IRevisionIncludeBuilder { } diff --git a/src/Raven.Client/Documents/Session/TimeSeries/TimeSeriesEntry.cs b/src/Raven.Client/Documents/Session/TimeSeries/TimeSeriesEntry.cs index 7207f37b1852..d4d42a21e5e7 100644 --- a/src/Raven.Client/Documents/Session/TimeSeries/TimeSeriesEntry.cs +++ b/src/Raven.Client/Documents/Session/TimeSeries/TimeSeriesEntry.cs @@ -18,6 +18,14 @@ namespace Raven.Client.Documents.Session.TimeSeries { + /// + /// Represents an individual entry in a time series, storing a timestamp, associated values, and metadata. + /// + /// + /// is used as a base type for time series data projections + /// in operations such as . + /// It contains a timestamp and associated values for a single entry within a time series. + /// public class TimeSeriesEntry : ITimeSeriesQueryStreamEntry { public DateTime Timestamp { get; set; }