Пример #1
0
        /// <summary>
        /// Returns a new <see cref="IJournal"/>, initialized with the provided actor.
        /// </summary>
        /// <param name="actor">
        /// The actor.
        /// </param>
        /// <returns>
        /// A new <see cref="IJournal"/>, initialized with the provided actor.
        /// </returns>
        public async Task <IJournal> Create(IGrain actor)
        {
            var table = Tables.GetOrAdd(
                actor.GetKind(),
                async _ =>
            {
                var t = this.client.GetTableReference(actor.GetKind() + TableNameSuffix);
                await t.CreateIfNotExistsAsync();
                return(t);
            });

            return(new AzureTableJournal(actor.GetIdString(), await table, this.jsonSettings));
        }
        /// <summary>
        /// Returns a new <see cref="IJournal"/>, initialized with the provided actor.
        /// </summary>
        /// <param name="actor">
        /// The actor.
        /// </param>
        /// <returns>
        /// A new <see cref="IJournal"/>, initialized with the provided actor.
        /// </returns>
        public async Task<IJournal> Create(IGrain actor)
        {
            var table = Tables.GetOrAdd(
                actor.GetKind(), 
                async _ =>
                {
                    var t = this.client.GetTableReference(actor.GetKind() + TableNameSuffix);
                    await t.CreateIfNotExistsAsync();
                    return t;
                });

            return new AzureTableJournal(actor.GetIdString(), await table, this.jsonSettings);
        }