示例#1
0
        public async Task<Response> Add(Request request)
        {
            var path = request.Path;
            var repo = request.Repository;
            var postData = request.Body;
            var json = await new StreamReader(postData).ReadToEndAsync();
            dynamic data = JObject.Parse(json);

            repo.AddApiKey(new ApiKey { Id = data.id, Secret = data.secret });

            return new SeeOtherResponse(request.Path);
        }
示例#2
0
 public async Task<Response> Show(Request request)
 {
     return new NotFoundResponse();
 }
示例#3
0
 public async Task<Response> List(Request request)
 {
     var repo = request.Repository;
     return new ViewResponse("ApiKeyList", new { ApiKeys = await repo.ApiKeys });
 }