public async Task UpdateActivityAsync(ActivityEntity activity) { ActivityTableEntity entity = await GetActivityEntityAsync(activity.Id); entity.Entity = activity; await this.storageAccessService.ReplaceAsync(Constants.TableNames.Activity, entity); }
public async Task <ActivityEntity> AddActivityAsync(ActivityEntity activity) { string activityFeedRowKey = ActivityKeyFactory.CreateRowKey(activity.Timestamp, activity.UserId); var entity = new ActivityTableEntity(ActivityKeyFactory.CreatePartitionKey(activity.Timestamp), activityFeedRowKey, activity); await this.storageAccessService.InsertAsync(Constants.TableNames.Activity, entity); string activityPerUserRowKey = ActivityKeyFactory.CreatePerUserRowKey(activity.Timestamp); var perUserEntity = new ActivityTableEntity(activity.UserId, activityPerUserRowKey, activity); await this.storageAccessService.InsertAsync(Constants.TableNames.ActivityPerUser, perUserEntity); await AddToPersonalizedFeedAsync(activity.UserId, activity); return(activity); }
public async Task AddToPersonalizedFeedAsync(string userId, ActivityEntity activity) { var personalEntity = new ActivityTableEntity(userId, activity.Id, activity); await this.storageAccessService.InsertOrMergeAsync(Constants.TableNames.ActivityUserFeed, personalEntity); }