public static StoryTableEntity ToStoryTableEntity(IStory story) { if (story == null) { return null; } var storyTableEntity = new StoryTableEntity() { Name = story.Name, Elapsed = story.Elapsed, StartDateTime = story.StartDateTime, InstanceId = story.InstanceId, Json = story.Serialize() }; storyTableEntity.UpdateKeys(story); return storyTableEntity; }
public static StoryTableEntity ToStoryTableEntity(IStory story) { if (story == null) { return(null); } var storyTableEntity = new StoryTableEntity() { Name = story.Name, Elapsed = story.Elapsed, StartDateTime = story.StartDateTime, InstanceId = story.InstanceId, Json = story.Serialize() }; storyTableEntity.UpdateKeys(story); return(storyTableEntity); }
private void PersistStoriesAsync(IList <IStory> stories) { var tableBatchOperation = new TableBatchOperation(); foreach (var story in stories) { tableBatchOperation.Add(TableOperation.Insert(StoryTableEntity.ToStoryTableEntity(story))); } try { Retrier.Retry <object>(() => { this.storiesTable.ExecuteBatch(tableBatchOperation); return(null); }); } catch (StorageException) { } }