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 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);
        }
        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. 6
0
        public async Task <IEnumerable <IPersonalData> > GetAsync(IEnumerable <string> id)
        {
            var partitionKey = PersonalDataEntity.GeneratePartitionKey();

            return(await _tableStorage.GetDataAsync(partitionKey, id));
        }
Esempio n. 7
0
        public Task SaveAsync(IPersonalData personalData)
        {
            var newEntity = PersonalDataEntity.Create(personalData);

            return(_tableStorage.InsertAsync(newEntity));
        }