-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExampleStore.cs
32 lines (27 loc) · 973 Bytes
/
ExampleStore.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using Microsoft.WindowsAzure.StorageClient;
namespace JoshCodes.Persistence.Azure.Storage.Testing.Unit
{
class ExampleStore : AzureObjectStore<IDefineExample, Example, Example.Entity>
{
public ExampleStore(CloudTableClient tableClient)
: base(tableClient, Example.EntityTableName)
{
}
protected override Example CreateObjectStore(Example.Entity entity)
{
return new Example(_tableClient, entity);
}
public Example Create()
{
return Create(Guid.NewGuid(), -1, 0.0, Guid.NewGuid().ToString(), null, Guid.Empty);
}
public Example Create(Guid key,
int number, double scalar, string text, Uri uri, Guid guid)
{
var entity = new Example.Entity(key, DateTime.UtcNow, number, scalar, text, uri, guid);
Create(entity);
return new Example(_tableClient, entity);
}
}
}