public MotivationByIdEntity(string userId, string motivationId, string motivationMessage, MotivationType motivationType) { PartitionKey = userId; RowKey = motivationId; MotivationMessage = motivationMessage; UserId = userId; MotivationType = motivationType.ToString(); }
public async Task <IEnumerable <Motivation> > GetMotivationsForType(MotivationType motivationType) { var motivationsByType = await _motivationEntityStore.GetByPartitionAsync(motivationType.ToString()); return(motivationsByType.Select(x => new Motivation { Id = new Guid(x.RowKey), MotivationType = (MotivationType)Enum.Parse(typeof(MotivationType), x.PartitionKey, true), MotivationMessage = x.MotivationMessage })); }
public Task InsertMotivation(string userId, MotivationType motivationType, string message) { var newMotivationId = Guid.NewGuid().ToString(); var motivationEntity = new MotivationEntity(motivationType.ToString(), newMotivationId, message, userId); var motivationEntityTask = _motivationEntityStore.SetAsync(motivationEntity); var motivationByIdEntity = new MotivationByIdEntity(userId, newMotivationId, message, motivationType); var motivationByIdEntityTask = _motivationByIdEntityStore.SetAsync(motivationByIdEntity); return(Task.WhenAll(new Task[] { motivationEntityTask, motivationByIdEntityTask })); }
public ScheduledPushEntity(string partitionKey, string rowKey, MotivationType motivationType) { PartitionKey = partitionKey; RowKey = rowKey; MotivationType = motivationType.ToString(); }