public async Task <ValueInfo> Get(int id)
        {
            var value = await repo.GetValueAsync(id);

            await linksService.AddLinksAsync(value);

            return(value);
        }
示例#2
0
        // GET api/values/568b9cbefbfd383c642a6dde/
        /// <summary>
        /// Get a value by id
        /// </summary>
        /// <remarks>The endpoint returns a Json representation of the object identified by the SHA-1 Id</remarks>
        /// <param name="id">
        /// <Description>A SHA-1 string id</Description>
        /// </param>
        public async Task <Value> Get(string id)
        {
            Value rv = null;

            try
            {
                rv = await repository.GetValueAsync(id);

                return(rv);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return(rv);
            }
        }
示例#3
0
 public Task <Either <string, ErrorDetails> > GetValueAsync() =>
 _valuesRepository
 .GetValueAsync("someId")
 .Then(retrievedValue => retrievedValue.Map(StringLength));