diff options
author | vman <public@vaughnnugent.com> | 2022-11-16 14:07:28 -0500 |
---|---|---|
committer | vman <public@vaughnnugent.com> | 2022-11-16 14:07:28 -0500 |
commit | 3fb601d14354c867e1ead94b027c99c4a2fc15b5 (patch) | |
tree | 5bf01312166d97eff255d1fdcd26bf314cebcf76 /VNLib.Plugins.Extensions.Data/Abstractions/IBulkDataStore.cs | |
parent | c3419e3e43f773ba9ee1e4854e15da873829fbd7 (diff) |
Add project files.
Diffstat (limited to 'VNLib.Plugins.Extensions.Data/Abstractions/IBulkDataStore.cs')
-rw-r--r-- | VNLib.Plugins.Extensions.Data/Abstractions/IBulkDataStore.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/VNLib.Plugins.Extensions.Data/Abstractions/IBulkDataStore.cs b/VNLib.Plugins.Extensions.Data/Abstractions/IBulkDataStore.cs new file mode 100644 index 0000000..3b6ab62 --- /dev/null +++ b/VNLib.Plugins.Extensions.Data/Abstractions/IBulkDataStore.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using System.Threading.Tasks; + +using VNLib.Utils; + +namespace VNLib.Plugins.Extensions.Data.Abstractions +{ + /// <summary> + /// An abstraction that defines a Data-Store that supports + /// bulk data operations + /// </summary> + /// <typeparam name="T">The data-model type</typeparam> + public interface IBulkDataStore<T> + { + /// <summary> + /// Deletes a collection of records from the store + /// </summary> + /// <param name="records">A collection of records to delete</param> + ///<returns>A task the resolves the number of entires removed from the store</returns> + Task<ERRNO> DeleteBulkAsync(ICollection<T> records); + /// <summary> + /// Updates a collection of records + /// </summary> + /// <param name="records">The collection of records to update</param> + /// <returns>A task the resolves an error code (should evaluate to false on failure, and true on success)</returns> + Task<ERRNO> UpdateBulkAsync(ICollection<T> records); + /// <summary> + /// Creates a bulk collection of records as entries in the store + /// </summary> + /// <param name="records">The collection of records to add</param> + /// <returns>A task the resolves an error code (should evaluate to false on failure, and true on success)</returns> + Task<ERRNO> CreateBulkAsync(ICollection<T> records); + /// <summary> + /// Creates or updates individual records from a bulk collection of records + /// </summary> + /// <param name="records">The collection of records to add</param> + /// <returns>A task the resolves an error code (should evaluate to false on failure, and true on success)</returns> + Task<ERRNO> AddOrUpdateBulkAsync(ICollection<T> records); + } + +} |