/// <summary> /// Create a repository wtier for the CosmosDB container (SQL API) /// </summary> /// <typeparam name="TID">Type of the identifier</typeparam> /// <typeparam name="TValue">Type of the value stored in the collection</typeparam> /// <param name="repoName">Name of v</param> /// <returns>A writer to make writer operations</returns> public IWriteRepository <TID, TValue> GetRepositoryWriter <TID, TValue>(string repoName, IIdentifierStrategy <TID> strategy) where TValue : IIdentifiable <TID> { var cosmosContainer = _db.GetContainer(repoName); return(new CosmosContainerWriter <TID, TValue>(cosmosContainer, strategy)); }
public IWriteRepository <TID, TValue> GetRepositoryWriter <TID, TValue>(string repoName, IIdentifierStrategy <TID> strategy = null) where TValue : IIdentifiable <TID> { if (_repo == null) { _repo = new MemoryRepository <TID, TValue>(); } return(_repo as IWriteRepository <TID, TValue>); }
/// <summary> /// Create a repository writer for the MongoDB collection /// </summary> /// <typeparam name="TID">Type of the identifier</typeparam> /// <typeparam name="TValue">Type of the value stored in the collection</typeparam> /// <param name="repoName">Name of MongoDB collection</param> /// <returns>A writer to make writer operations</returns> public IWriteRepository <TID, TValue> GetRepositoryWriter <TID, TValue>(string repoName, IIdentifierStrategy <TID> strategy = null) where TValue : IIdentifiable <TID> { var mongoCollection = _db.GetCollection <TValue>(repoName); return(new MongoCollectionWriter <TID, TValue>(mongoCollection)); }
internal CosmosContainerWriter(Container container, IIdentifierStrategy <TID> strategy) : base(container, strategy) { }
internal CosmosContainer(Container container, IIdentifierStrategy <TID> strategy) { this.Container = container; _idStrategy = strategy; }