You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Configuring encrypted properties in Umbraco UI Builder, the backoffice UI builder for Umbraco.
2
+
description: Configuring and using encrypted properties in Umbraco UI Builder to securely store sensitive data.
3
3
---
4
4
5
5
# Encrypted Properties
6
6
7
-
If needed to collect sensitive information in a collection but don't want to persist in a plain text format to the data storage mechanism. Umbraco UI Builder can help with this by allowing you to define properties as encrypted. After which any time the value is persisted or retrieved from persistence, Umbraco UI Builder will automatically encrypt and decrypt the value.
7
+
Umbraco UI Builder allows encrypting properties to store sensitive information securely. When a property is marked as encrypted, its value is automatically encrypted before storage and decrypted upon retrieval.
8
8
9
9
{% hint style="info" %}
10
-
Umbraco UI Builder uses the `IDataProtectionProvider` instance registered in the DI container to perform its encryption/decryption. If you need to change the encryption algorithm, you should replace the `IDataProtectionProvider` instance in the DI container.
10
+
Umbraco UI Builder uses the `IDataProtectionProvider` instance registered in the DI container for encryption and decryption. To modify the encryption algorithm, replace the `IDataProtectionProvider` instance in the DI container.
Adds the given property to the encrypted properties collection. Property must be of type `String`. When set, the property will be encrypted/decrypted on write/read respectively.
17
+
Encrypts the specified property. The property must be of type `String`. The value is encrypted before storage and decrypted when retrieved.
Copy file name to clipboardExpand all lines: 15/umbraco-ui-builder/advanced/repositories.md
+47-17Lines changed: 47 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
-
description: Configuring repositories in Umbraco UI Builder, the backoffice UI builder for Umbraco.
2
+
description: Configure repositories in Umbraco UI Builder.
3
3
---
4
4
5
5
# Repositories
6
6
7
-
Repositories are used by Umbraco UI Builder to access the entity data stores. By default, collections will use a generic built-in NPoco repository. However, you can define your own repository implementation should you wish to store your entities via an alternative strategy.
7
+
Repositories in Umbraco UI Builder manage entity data storage. By default, collections use a built-in NPoco repository. To use a different storage strategy, define a custom repository implementation.
8
8
9
-
## Defining a repository
9
+
## Defining a Repository
10
10
11
-
To define a repository create a class that inherits from the base class `Repository<TEntity, TId>` and implements all of its abstract methods.
11
+
Create a class that inherits from `Repository<TEntity, TId>` and implements all abstract methods.
12
12
13
13
````csharp
14
14
// Example
@@ -58,39 +58,62 @@ public class PersonRepository : Repository<Person, int> {
58
58
}
59
59
````
60
60
61
-
**Note:** For all `Impl` methods there are public alternatives without the `Impl` suffix. However, there are separate implementation methods in order to ensure all repositories fire the relevant Umbraco UI Builder events. This is whether triggered via the Umbraco UI Builder's UI or not.
61
+
{% hint style="info" %}
62
+
`Impl` methods have public alternatives without the suffix. Separate implementation methods ensure repositories trigger Umbraco UI Builder events, whether actions originate from the UI or not.
63
+
{% endhint %}
62
64
63
-
## Changing the repository implementation of a collection
65
+
## Changing the Repository Implementation of a Collection
To help with accessing a repository (default or custom) Umbraco UI Builder has an `IRepositoryFactory` you can inject into your code base. This includes a couple of factory methods to create the repository instances for you.
86
102
Repositories should only be created via the repository factory as there are some injected dependencies that can only be resolved by Umbraco UI Builder.
### Using the `GetRepository<TEntity, TId>()` Method
89
105
90
106
Creates a repository for the given entity type. Umbraco UI Builder will search the configuration for the first section/collection with a configuration for the given entity type. Then it will use that as a repository configuration.
description: Configuring value mappers in Umbraco UI Builder, the backoffice UI builder for Umbraco.
2
+
description: Configuring value mappers in Umbraco UI Builder to modify how data is stored and retrieved.
3
3
---
4
4
5
5
# Value Mappers
6
6
7
-
A value mapper is an Umbraco UI Builder helper class that sits between the editor UI and the database. It also lets you tweak the stored value of a field. By default Umbraco UI Builder will save a datatype value as it would be stored in Umbraco. Value mappers let you change this.
7
+
Value mappers in Umbraco UI Builder act as intermediaries between the editor UI and the database, allowing customization of stored field values. By default, Umbraco UI Builder saves data as it would be stored in Umbraco, but value mappers enable modifications.
8
8
9
-
When Umbraco UI Builder resolves a value mapper it will attempt to do so from the global DI container. This means you can inject any dependencies that you require for your mapper. If there is no type defined in the DI container, Umbraco UI Builder will fall-back to manually instantiating a new instance of value mapper.
9
+
When resolving a value mapper, Umbraco UI Builder first checks the global DI container. If no type is defined, it manually instantiates a new instance.
10
10
11
-
## Defining a value mapper
11
+
## Defining a Value Mapper
12
12
13
-
To define a mapper create a class that inherits from the base class `ValueMapper` and implements the methods `EditorToModel` and `ModelToEditor`.
13
+
To define a mapper, create a class that inherits from the base class `ValueMapper` and implements the `EditorToModel` and `ModelToEditor` methods.
14
+
15
+
### Example
14
16
15
17
````csharp
16
-
// Example
17
18
publicclassMyValueMapper : ValueMapper
18
19
{
19
20
publicoverrideobjectEditorToModel(objectinput)
@@ -30,33 +31,54 @@ public class MyValueMapper : ValueMapper
30
31
}
31
32
````
32
33
33
-
## Setting a field value mapper
34
+
## Setting a Field Value Mapper
34
35
35
36
Value mappers are defined as part of a collection editor field configuration.
0 commit comments