Skip to content

Commit d9c3d81

Browse files
authored
Merge pull request #20 from geeklearningio/release/0.5.0
Release/0.5.0
2 parents 9200a32 + bb398a3 commit d9c3d81

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": [ "src", "tests", "samples" ],
33
"sdk": {
4-
"version": "1.0.0-preview2-003121"
4+
"version": "1.0.0-preview2-003133"
55
}
66
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
6+
using System.Text;
7+
8+
// For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
9+
10+
namespace GeekLearning.Storage.BasicSample.Controllers
11+
{
12+
[Route("api/[controller]")]
13+
public class SampleController : Controller
14+
{
15+
private IStore sharedAssets;
16+
17+
public SampleController(IStorageFactory storageFactory)
18+
{
19+
this.sharedAssets = storageFactory.GetStore("SharedAssets");
20+
}
21+
22+
// GET: api/values
23+
[HttpGet]
24+
public async Task<IEnumerable<string>> Get()
25+
{
26+
var summaries = await this.sharedAssets.ListAsync("summaries", "*.txt", recursive: true, withMetadata: false);
27+
return summaries.Select(x => x.Path);
28+
}
29+
30+
// GET api/values/5
31+
[HttpGet]
32+
public async Task<string> Get(string path)
33+
{
34+
var summary = await this.sharedAssets.GetAsync(path);
35+
return await summary.ReadAllTextAsync();
36+
}
37+
38+
// PUT api/values/5
39+
[HttpPut()]
40+
public async Task Put(string path, [FromBody]string value)
41+
{
42+
await sharedAssets.SaveAsync(Encoding.UTF8.GetBytes(value), path, "text/plain");
43+
}
44+
45+
// DELETE api/values/5
46+
[HttpDelete()]
47+
public async Task Delete(string path)
48+
{
49+
await sharedAssets.DeleteAsync(path);
50+
}
51+
}
52+
}

src/GeekLearning.Storage.Azure/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"NETStandard.Library": "1.6.0",
1313
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0",
1414
"Microsoft.Extensions.Options": "1.0.0",
15-
"WindowsAzure.Storage": "7.2.0",
15+
"WindowsAzure.Storage": "7.2.1",
1616
"GeekLearning.Storage": "*",
1717
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0"
1818
},

0 commit comments

Comments
 (0)