diff --git a/csharp/Platform.Data/ILinksExtensions.cs b/csharp/Platform.Data/ILinksExtensions.cs
index 4fcf77a7..3f2ae870 100644
--- a/csharp/Platform.Data/ILinksExtensions.cs
+++ b/csharp/Platform.Data/ILinksExtensions.cs
@@ -18,8 +18,48 @@ namespace Platform.Data
///
public static class ILinksExtensions
{
+ ///
+ ///
+ /// Creates a new link with no specific content.
+ ///
+ ///
+ ///
+ ///
+ /// The type used to represent link addresses.
+ ///
+ ///
+ ///
+ /// The links storage to create the link in.
+ ///
+ ///
+ ///
+ /// The address of the created link.
+ ///
+ ///
public static TLinkAddress Create(this ILinks> links) where TLinkAddress : IUnsignedNumber => links.Create(null);
+ ///
+ ///
+ /// Creates a new link with the specified content.
+ ///
+ ///
+ ///
+ ///
+ /// The type used to represent link addresses.
+ ///
+ ///
+ ///
+ /// The links storage to create the link in.
+ ///
+ ///
+ ///
+ /// The content for the new link.
+ ///
+ ///
+ ///
+ /// The address of the created link.
+ ///
+ ///
public static TLinkAddress Create(this ILinks> links, IList? substitution) where TLinkAddress : IUnsignedNumber
{
var constants = links.Constants;
@@ -28,6 +68,32 @@ public static TLinkAddress Create(this ILinks
+ ///
+ /// Updates links that match the specified restriction with new content.
+ ///
+ ///
+ ///
+ ///
+ /// The type used to represent link addresses.
+ ///
+ ///
+ ///
+ /// The links storage to update links in.
+ ///
+ ///
+ ///
+ /// The restriction criteria for selecting links to update.
+ ///
+ ///
+ ///
+ /// The new content for the matching links.
+ ///
+ ///
+ ///
+ /// The address of the updated link.
+ ///
+ ///
public static TLinkAddress Update(this ILinks> links, IList? restriction, IList? substitution) where TLinkAddress : IUnsignedNumber
{
var constants = links.Constants;
@@ -36,8 +102,52 @@ public static TLinkAddress Update(this ILinks
+ ///
+ /// Deletes the specified link from the storage.
+ ///
+ ///
+ ///
+ ///
+ /// The type used to represent link addresses.
+ ///
+ ///
+ ///
+ /// The links storage to delete the link from.
+ ///
+ ///
+ ///
+ /// The address of the link to delete.
+ ///
+ ///
+ ///
+ /// The result of the delete operation.
+ ///
+ ///
public static TLinkAddress Delete(this ILinks> links, TLinkAddress linkToDelete) where TLinkAddress : IUnsignedNumber => Delete(links, (IList?)new LinkAddress(linkToDelete));
+ ///
+ ///
+ /// Deletes links that match the specified restriction criteria.
+ ///
+ ///
+ ///
+ ///
+ /// The type used to represent link addresses.
+ ///
+ ///
+ ///
+ /// The links storage to delete links from.
+ ///
+ ///
+ ///
+ /// The restriction criteria for selecting links to delete.
+ ///
+ ///
+ ///
+ /// The result of the delete operation.
+ ///
+ ///
public static TLinkAddress Delete(this ILinks> links, IList? restriction) where TLinkAddress : IUnsignedNumber
{
var constants = links.Constants;
diff --git a/csharp/Platform.Data/Universal/IUniLinks.cs b/csharp/Platform.Data/Universal/IUniLinks.cs
index 8faf2687..c7a04fed 100644
--- a/csharp/Platform.Data/Universal/IUniLinks.cs
+++ b/csharp/Platform.Data/Universal/IUniLinks.cs
@@ -31,9 +31,37 @@ public partial interface IUniLinks
IList?>> Trigger(IList? condition, IList? substitution);
}
+ ///
+ ///
+ /// Defines the universal links interface for step by step operations.
+ ///
+ ///
+ ///
/// Minimal sufficient universal Links API (for step by step operations).
public partial interface IUniLinks
{
+ ///
+ ///
+ /// Triggers an operation based on pattern matching and substitution with handlers.
+ ///
+ ///
+ ///
+ ///
+ /// The pattern or condition for matching links.
+ ///
+ ///
+ ///
+ /// The handler function called for each matched link.
+ ///
+ ///
+ ///
+ /// The substitution content to apply.
+ ///
+ ///
+ ///
+ /// The handler function called for each substitution operation.
+ ///
+ ///
///
/// TLinkAddress that represents True (was finished fully) or TLinkAddress that represents False (was stopped).
/// This is done to assure ability to push up stop signal through recursion stack.
@@ -76,9 +104,29 @@ TLinkAddress Trigger(IList? restriction, WriteHandler? substitution, WriteHandler? substitutedHandler);
}
+ ///
+ ///
+ /// Defines the universal links interface extended with optimization methods.
+ ///
+ ///
+ ///
/// Extended with small optimization.
public partial interface IUniLinks
{
+ ///
+ ///
+ /// Counts the number of links that match the specified restrictions.
+ ///
+ ///
+ ///
+ ///
+ /// The restrictions to apply when counting links.
+ ///
+ ///
+ ///
+ /// The count of links matching the restrictions.
+ ///
+ ///
///
/// Something simple should be simple and optimized.
///
diff --git a/csharp/Platform.Data/Universal/IUniLinksCRUD.cs b/csharp/Platform.Data/Universal/IUniLinksCRUD.cs
index a569b73e..8e0bee23 100644
--- a/csharp/Platform.Data/Universal/IUniLinksCRUD.cs
+++ b/csharp/Platform.Data/Universal/IUniLinksCRUD.cs
@@ -93,6 +93,10 @@ public interface IUniLinksCRUD
/// The parts.
///
///
+ ///
+ /// The result of the delete operation.
+ ///
+ ///
TLinkAddress Delete(IList? parts);
}
}
diff --git a/csharp/Platform.Data/Universal/IUniLinksIO.cs b/csharp/Platform.Data/Universal/IUniLinksIO.cs
index 78f8ebe0..d0f49948 100644
--- a/csharp/Platform.Data/Universal/IUniLinksIO.cs
+++ b/csharp/Platform.Data/Universal/IUniLinksIO.cs
@@ -12,6 +12,24 @@ namespace Platform.Data.Universal
///
public interface IUniLinksIO
{
+ ///
+ ///
+ /// Outputs links that match the specified pattern using the provided handler.
+ ///
+ ///
+ ///
+ ///
+ /// The handler function to process each matching link.
+ ///
+ ///
+ ///
+ /// The pattern to match against links.
+ ///
+ ///
+ ///
+ /// True if all links were processed successfully, false if stopped by handler.
+ ///
+ ///
///
/// default(TLinkAddress) means any link.
/// Single element pattern means just element (link).
@@ -31,6 +49,24 @@ public interface IUniLinksIO
///
bool Out(Func?, bool> handler, IList? pattern);
+ ///
+ ///
+ /// Performs an input operation to create, update, or delete links based on before/after states.
+ ///
+ ///
+ ///
+ ///
+ /// The state of the link before the operation.
+ ///
+ ///
+ ///
+ /// The state of the link after the operation.
+ ///
+ ///
+ ///
+ /// The result of the input operation.
+ ///
+ ///
///
/// default(TLinkAddress) means itself.
/// Equivalent to:
diff --git a/csharp/Platform.Data/Universal/IUniLinksIOWithExtensions.cs b/csharp/Platform.Data/Universal/IUniLinksIOWithExtensions.cs
index 2da78975..94256b82 100644
--- a/csharp/Platform.Data/Universal/IUniLinksIOWithExtensions.cs
+++ b/csharp/Platform.Data/Universal/IUniLinksIOWithExtensions.cs
@@ -8,6 +8,24 @@ namespace Platform.Data.Universal
/// Contains some optimizations of Out.
public interface IUniLinksIOWithExtensions : IUniLinksIO
{
+ ///
+ ///
+ /// Outputs a specific part of a link matching the pattern.
+ ///
+ ///
+ ///
+ ///
+ /// The type of part to retrieve (0=index, 1=source, 2=target, etc.).
+ ///
+ ///
+ ///
+ /// The pattern to match against links.
+ ///
+ ///
+ ///
+ /// The specified part of the matching link, or default value if not found.
+ ///
+ ///
///
/// default(TLinkAddress) means nothing or null.
/// Single element pattern means just element (link).
@@ -22,9 +40,37 @@ public interface IUniLinksIOWithExtensions : IUniLinksIO
TLinkAddress OutOne(int partType, IList? pattern);
+ ///
+ ///
+ /// Outputs all links matching the specified pattern as an array.
+ ///
+ ///
+ ///
+ ///
+ /// The pattern to match against links.
+ ///
+ ///
+ ///
+ /// An array of all links matching the pattern.
+ ///
+ ///
/// OutCount() returns total links in store as array.
IList?> OutAll(IList? pattern);
+ ///
+ ///
+ /// Counts the total number of links matching the specified pattern.
+ ///
+ ///
+ ///
+ ///
+ /// The pattern to match against links.
+ ///
+ ///
+ ///
+ /// The total count of links matching the pattern.
+ ///
+ ///
/// OutCount() returns total amount of links in store.
ulong OutCount(IList? pattern);
}
diff --git a/csharp/Platform.Data/WriteHandlerState.cs b/csharp/Platform.Data/WriteHandlerState.cs
index 058383ed..41c95d15 100644
--- a/csharp/Platform.Data/WriteHandlerState.cs
+++ b/csharp/Platform.Data/WriteHandlerState.cs
@@ -4,12 +4,54 @@
namespace Platform.Data
{
+ ///
+ ///
+ /// Represents a state manager for write handler operations in the links system.
+ ///
+ ///
+ ///
+ ///
+ /// The type used to represent link addresses.
+ ///
+ ///
public struct WriteHandlerState where TLinkAddress : IUnsignedNumber
{
+ ///
+ ///
+ /// Gets or sets the result of the write handler operation.
+ ///
+ ///
+ ///
public TLinkAddress Result;
+
+ ///
+ ///
+ /// Gets or sets the write handler function used to process link changes.
+ ///
+ ///
+ ///
public WriteHandler? Handler;
+
private TLinkAddress Break;
+ ///
+ ///
+ /// Initializes a new instance.
+ ///
+ ///
+ ///
+ ///
+ /// A value indicating that processing should continue.
+ ///
+ ///
+ ///
+ /// A value indicating that processing should break/stop.
+ ///
+ ///
+ ///
+ /// A handler function for processing write operations.
+ ///
+ ///
public WriteHandlerState(TLinkAddress @continue, TLinkAddress @break, WriteHandler? handler)
{
Break = @break;
@@ -17,6 +59,16 @@ public WriteHandlerState(TLinkAddress @continue, TLinkAddress @break, WriteHandl
Handler = handler;
}
+ ///
+ ///
+ /// Applies the specified result and updates the handler state accordingly.
+ ///
+ ///
+ ///
+ ///
+ /// The result value to apply to the state.
+ ///
+ ///
public void Apply(TLinkAddress result)
{
var isAlreadyBreak = (Break == Result);
@@ -30,6 +82,24 @@ public void Apply(TLinkAddress result)
}
+ ///
+ ///
+ /// Handles the write operation with the specified before and after link states.
+ ///
+ ///
+ ///
+ ///
+ /// The link state before the operation.
+ ///
+ ///
+ ///
+ /// The link state after the operation.
+ ///
+ ///
+ ///
+ /// The result of the handler operation.
+ ///
+ ///
public TLinkAddress Handle(IList before, IList after)
{
if (Handler != null)