Class PropertyBuilderExtensions
Extension methods for configuration of properties that should be stored as json.
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: IRM.EntityFrameworkCore.Storage
Assembly: IRM.EntityFrameworkCore.Storage.Json.dll
Syntax
public static class PropertyBuilderExtensions
Methods
HasJsonConversion<T>(PropertyBuilder<T>, JsonSerializerOptions)
Configures the property so that the property value is converted to and from the database using the JsonValueConverter<T>.
Declaration
public static PropertyBuilder<T> HasJsonConversion<T>(this PropertyBuilder<T> builder, JsonSerializerOptions options = null)
where T : class
Parameters
Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<T>
builder
The builder for the property being configured. |
System.Text.Json.JsonSerializerOptions
options
Options to control serialization behavior |
Returns
Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<T>
The same builder instance so that multiple configuration calls can be chained. |
Type Parameters
T
The type of object to serialize/deserialize to Json. |
StoreAsJson<T>(PropertyBuilder<T>, DbContext, JsonSerializerOptions)
Configures a property to be stored as Json in database.
Declaration
public static PropertyBuilder<T> StoreAsJson<T>(this PropertyBuilder<T> builder, DbContext context, JsonSerializerOptions options = null)
where T : class
Parameters
Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<T>
builder
The builder for the property being configured. |
Microsoft.EntityFrameworkCore.DbContext
context
The Microsoft.EntityFrameworkCore.DbContext that the |
System.Text.Json.JsonSerializerOptions
options
Options to control serialization behavior |
Returns
Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<T>
The same builder instance so that multiple calls can be chained. |
Type Parameters
T
|