public async Task <ActionResult> GetRecordsByName(
            [FromQuery(Name = "name")]
            string recordName,
            [FromQuery(Name = "type")]
            string recordType)
        {
            if (recordName == null)
            {
                return(BadRequest());
            }

            RecordKey record;

            try
            {
                record = RecordKey.ParseRecord(recordType, LedgerPath.FromSegments(), recordName);
            }
            catch (ArgumentOutOfRangeException)
            {
                return(BadRequest());
            }

            IReadOnlyList <Record> records = await this.indexes.GetAllRecords(record.RecordType, record.Name);

            return(Json(records.Select(GetRecordJson).ToArray()));
        }