Пример #1
0
 public static void Encode(this PersonalDataPostgresEntity entity, byte[] key)
 {
     entity.City                 = entity.City?.EncodeString(key);
     entity.Email                = entity.Email?.EncodeString(key);
     entity.Phone                = entity.Phone?.EncodeString(key);
     entity.FirstName            = entity.FirstName?.EncodeString(key);
     entity.LastName             = entity.LastName?.EncodeString(key);
     entity.PostalCode           = entity.PostalCode?.EncodeString(key);
     entity.CountryOfCitizenship = entity.CountryOfCitizenship?.EncodeString(key);
     entity.CountryOfResidence   = entity.CountryOfResidence?.EncodeString(key);
     entity.Address              = entity.Address?.EncodeString(key);
 }
        public async Task CreateAsync(PersonalDataPostgresEntity pd, byte[] initKey)
        {
            pd.Encode(initKey);

            await _postgresConnection.Insert(TableName).SetInsertModel(pd).ExecuteAsync();
        }