コード例 #1
0
        public async Task <HttpResponseMessage> GetSchemas(string schemaId = null)
        {
            if (string.IsNullOrWhiteSpace(schemaId))
            {
                return((await _SchemaService.GetSchemas())
                       .Let(schemata => SetMetaLocations(schemata, GetSchemasRouteName, schema => new { schemaId = schema.Id }))
                       .ToHttpResponseMessage(Request));
            }

            return((await _SchemaService.GetSchema(schemaId))
                   .Let(schema => SetMetaLocation(schema, GetSchemasRouteName, new { schemaId = schema.Id }))
                   .ToHttpResponseMessage(Request, (schema, response) => SetContentLocationHeader(response, GetSchemasRouteName, new { schemaId = schema.Id })));
        }
コード例 #2
0
        public IActionResult Get(string name)
        {
            var schema = schemaService.GetSchema(name);

            return(Ok(schema));
        }