Exemplo n.º 1
0
        public virtual async Task <IActionResult> GetMetadataByIdAsync(
            [FromRoute] string source,
            [FromRoute] string id)
        {
            try
            {
                var entity = (await timeseriesMetadataRepository
                              .FindAsync(e => e.Source == source && e.Id == id)).FirstOrDefault();
                if (entity == null)
                {
                    return(NotFound($"No data found for timeseries metadata id {id}"));
                }

                return(Ok(entity));
            }
            catch (Exception e)
            {
                return(this.InternalServerError(e.FlattenMessages()));
            }
        }