Class UpdateEntryExtensions
- Namespace
- Microsoft.EntityFrameworkCore.Update
- Assembly
- Microsoft.EntityFrameworkCore.dll
Extension methods for IUpdateEntry.
public static class UpdateEntryExtensions
- Inheritance
-
UpdateEntryExtensions
- Inherited Members
Remarks
See Implementation of database providers and extensions for more information and examples.
Methods
BuildCurrentValuesString(IUpdateEntry, IEnumerable<IPropertyBase>)
Creates a formatted string representation of the given properties and their current values such as is useful when throwing exceptions about keys, indexes, etc. that use the properties.
public static string BuildCurrentValuesString(this IUpdateEntry entry, IEnumerable<IPropertyBase> properties)
Parameters
entry
IUpdateEntryThe entry from which values will be obtained.
properties
IEnumerable<IPropertyBase>The properties to format.
Returns
- string
The string representation.
BuildOriginalValuesString(IUpdateEntry, IEnumerable<IPropertyBase>)
Creates a formatted string representation of the given properties and their original values such as is useful when throwing exceptions about keys, indexes, etc. that use the properties.
public static string BuildOriginalValuesString(this IUpdateEntry entry, IEnumerable<IPropertyBase> properties)
Parameters
entry
IUpdateEntryThe entry from which values will be obtained.
properties
IEnumerable<IPropertyBase>The properties to format.
Returns
- string
The string representation.
GetCurrentProviderValue(IUpdateEntry, IProperty)
Gets the value assigned to the property and converts it to the provider-expected value.
public static object? GetCurrentProviderValue(this IUpdateEntry updateEntry, IProperty property)
Parameters
updateEntry
IUpdateEntryThe entry.
property
IPropertyThe property to get the value for.
Returns
- object
The value for the property.
GetOriginalProviderValue(IUpdateEntry, IProperty)
Gets the original value that was assigned to the property and converts it to the provider-expected value.
public static object? GetOriginalProviderValue(this IUpdateEntry updateEntry, IProperty property)
Parameters
updateEntry
IUpdateEntryThe entry.
property
IPropertyThe property to get the value for.
Returns
- object
The value for the property.
ToDebugString(IUpdateEntry, ChangeTrackerDebugStringOptions, int)
Creates a human-readable representation of the given IUpdateEntry.
Warning: Do not rely on the format of the returned string. It is designed for debugging only and may change arbitrarily between releases.
public static string ToDebugString(this IUpdateEntry updateEntry, ChangeTrackerDebugStringOptions options = ChangeTrackerDebugStringOptions.LongDefault, int indent = 0)
Parameters
updateEntry
IUpdateEntryThe entry.
options
ChangeTrackerDebugStringOptionsOptions for generating the string.
indent
intThe number of indent spaces to use before each new line.
Returns
- string
A human-readable representation.
Remarks
See EF Core debug views for more information and examples.