public async Task <IClientAccount> GetByIdAsync(string id) { var partitionKey = ClientAccountEntity.GeneratePartitionKey(); var rowKey = ClientAccountEntity.GenerateRowKey(id); return(await _clientsTablestorage.GetDataAsync(partitionKey, rowKey)); }
public Task ChangePhoneAsync(string clientId, string phoneNumber) { var partitionKey = ClientAccountEntity.GeneratePartitionKey(); var rowKey = ClientAccountEntity.GenerateRowKey(clientId); return(_clientsTablestorage.ReplaceAsync(partitionKey, rowKey, itm => { itm.Phone = phoneNumber; return itm; })); }
public Task ChangePassword(string clientId, string newPassword) { var partitionKey = ClientAccountEntity.GeneratePartitionKey(); var rowKey = ClientAccountEntity.GenerateRowKey(clientId); return(_clientsTablestorage.ReplaceAsync(partitionKey, rowKey, itm => { itm.SetPassword(newPassword); return itm; })); }
public async Task <string> GenerateNotificationsId(string clientId) { var partitionKey = ClientAccountEntity.GeneratePartitionKey(); var rowKey = ClientAccountEntity.GenerateRowKey(clientId); var updated = await _clientsTablestorage.ReplaceAsync(partitionKey, rowKey, itm => { itm.NotificationsId = Guid.NewGuid().ToString("N"); return(itm); }); return(updated.NotificationsId); }
public async Task <bool> IsPasswordCorrect(string clientId, string password) { if (string.IsNullOrEmpty(clientId)) { return(false); } var entity = await _clientsTablestorage.GetDataAsync(ClientAccountEntity.GeneratePartitionKey(), ClientAccountEntity.GenerateRowKey(clientId)); if (entity != null) { return(entity.CheckPassword(password)); } return(false); }
public async Task <IEnumerable <IClientAccount> > GetByIdAsync(string[] ids) { var partitionKey = ClientAccountEntity.GeneratePartitionKey(); return(await _clientsTablestorage.GetDataAsync(partitionKey, ids)); }