public async Task <KycStatus> GetKycStatusAsync(string clientId) { var rowKey = KycEntity.GenerateRowKey(clientId); var entity = (await _tableStorage.GetDataRowKeyOnlyAsync(rowKey)).FirstOrDefault(); return(entity?.GetSatus() ?? KycEntity.DefaultStatus); }
public async Task SetStatusAsync(string clientId, KycStatus status) { var rowKey = KycEntity.GenerateRowKey(clientId); var entity = (await _tableStorage.GetDataRowKeyOnlyAsync(rowKey)).FirstOrDefault(); if (entity != null) { await _tableStorage.DeleteAsync(entity); } if (status == KycEntity.DefaultStatus) { return; } entity = KycEntity.Create(clientId, status); await _tableStorage.InsertOrReplaceAsync(entity); }