Esempio n. 1
0
        public async Task <IPersonalData> GetAsync(string id)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();
            var rowKey       = PersonalDataEntity.GenerateRowKey(id);

            return(await _tableStorage.GetDataAsync(partitionKey, rowKey));
        }
Esempio n. 2
0
        public async Task <IPersonalData> ScanAndFindAsync(Func <IPersonalData, bool> func)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();

            return
                (await
                 _tableStorage.FirstOrNullViaScanAsync(partitionKey,
                                                       dataToSearch => dataToSearch.FirstOrDefault(pa => func(pa))));
        }
Esempio n. 3
0
        public Task UpdateAsync(IPersonalData personalData)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();
            var rowKey       = PersonalDataEntity.GenerateRowKey(personalData.Id);

            return(_tableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.Update(personalData);
                return itm;
            }));
        }
Esempio n. 4
0
        public Task ChangeContactPhoneAsync(string id, string phoneNumber)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();
            var rowKey       = PersonalDataEntity.GenerateRowKey(id);

            return(_tableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.ContactPhone = phoneNumber;
                return itm;
            }));
        }
Esempio n. 5
0
        public Task ChangeAddressAsync(string id, string address)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();
            var rowKey       = PersonalDataEntity.GenerateRowKey(id);

            return(_tableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.Address = address;
                return itm;
            }));
        }
Esempio n. 6
0
        public Task ChangeZipAsync(string id, string zip)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();
            var rowKey       = PersonalDataEntity.GenerateRowKey(id);

            return(_tableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.Zip = zip;
                return itm;
            }));
        }
Esempio n. 7
0
        public Task ChangeCountryAsync(string id, string country)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();
            var rowKey       = PersonalDataEntity.GenerateRowKey(id);

            return(_tableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.Country = country;
                return itm;
            }));
        }
Esempio n. 8
0
        public Task ChangeLastNameAsync(string id, string lastName)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();
            var rowKey       = PersonalDataEntity.GenerateRowKey(id);

            return(_tableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.LastName = lastName;
                return itm;
            }));
        }
Esempio n. 9
0
        public Task UpdateGeolocationDataAsync(string id, string countryCode, string city)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();
            var rowKey       = PersonalDataEntity.GenerateRowKey(id);

            return(_tableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.Country = countryCode;
                itm.City = city;
                return itm;
            }));
        }
Esempio n. 10
0
        public static PersonalDataEntity Create(IPersonalData src)
        {
            var result = new PersonalDataEntity
            {
                PartitionKey = GeneratePartitionKey(),
                RowKey       = GenerateRowKey(src.Id),
                Email        = src.Email,
                Regitered    = src.Regitered
            };

            result.Update(src);

            return(result);
        }
Esempio n. 11
0
        public async Task GetByChunksAsync(Action <IEnumerable <IPersonalData> > callback)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();

            await _tableStorage.GetDataByChunksAsync(partitionKey, callback);
        }
Esempio n. 12
0
        public Task SaveAsync(IFullPersonalData personalData)
        {
            var newEntity = PersonalDataEntity.Create(personalData);

            return(_tableStorage.InsertAsync(newEntity));
        }
Esempio n. 13
0
        public async Task <IEnumerable <IPersonalData> > GetAsync(IEnumerable <string> id)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();

            return(await _tableStorage.GetDataAsync(partitionKey, id));
        }