本文整理汇总了C#中DataStore.Save方法的典型用法代码示例。如果您正苦于以下问题:C# DataStore.Save方法的具体用法?C# DataStore.Save怎么用?C# DataStore.Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStore
的用法示例。
在下文中一共展示了DataStore.Save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveQueue
public async Task SaveQueue()
{
var random = new Random();
var fileName = Guid.NewGuid().ToString();
var content = new byte[32];
random.NextBytes(content);
var version = Guid.NewGuid().ToString();
var mimeType = Guid.NewGuid().ToString();
var identifier = Guid.NewGuid();
var queueForResize = true;
var extension = Guid.NewGuid().ToString();
var quality = (byte)100;
var width = (ushort)122;
var height = (ushort)133;
var imaging = Substitute.For<IImaging>();
var container = Substitute.For<IContainer>();
container.Save(fileName, content, mimeType);
container.SetCacheControl(fileName, 31536000);
var table = Substitute.For<ITableStorage>();
table.InsertOrReplace(Arg.Any<ImageEntity>());
var queue = Substitute.For<IStorageQueue>();
queue.Save(Arg.Any<ImageQueued>());
var naming = Substitute.For<INaming>();
var store = new DataStore(imaging, container, table, queue, naming);
await store.Save(fileName, content, version, mimeType, identifier, queueForResize, extension, quality, width, height);
queue.Received().Save(Arg.Any<ImageQueued>());
container.Received().Save(fileName, content, mimeType);
container.Received().SetCacheControl(fileName, 31536000);
table.Received().InsertOrReplace(Arg.Any<ImageEntity>());
}
示例2: Add
public void Add(TodoListItem item)
{
var store = new DataStore();
store.Save(item);
}