Example #1
0
        /// <summary>
        /// Get a single actor by ID
        /// </summary>
        /// <param name="actorId">ID</param>
        /// <returns>Actor object</returns>
        public Actor GetActor(string actorId)
        {
            if (ActorsIndex.ContainsKey(actorId))
            {
                return(ActorsIndex[actorId]);
            }

            throw new CosmosException("Not Found", System.Net.HttpStatusCode.NotFound, 404, string.Empty, 0);
        }
Example #2
0
        /// <summary>
        /// Get a single actor by ID
        /// </summary>
        /// <param name="actorId">ID</param>
        /// <returns>Actor object</returns>
        public async Task <Actor> GetActorAsync(string actorId)
        {
            return(await Task.Run(() =>
            {
                if (ActorsIndex.ContainsKey(actorId))
                {
                    return ActorsIndex[actorId];
                }

                throw new CosmosException("Not Found", System.Net.HttpStatusCode.NotFound, 404, string.Empty, 0);
            }).ConfigureAwait(false));
        }