Table of Contents

Class DateTimeOffsetToBinaryConverter

Namespace
Microsoft.EntityFrameworkCore.Storage.ValueConversion
Assembly
Microsoft.EntityFrameworkCore.dll

Converts DateTime to and from binary representation in a long. The DateTime is truncated beyond 0.1 millisecond precision.

public class DateTimeOffsetToBinaryConverter : ValueConverter<DateTimeOffset, long>
Inheritance
DateTimeOffsetToBinaryConverter
Inherited Members

Remarks

See EF Core value converters for more information and examples.

Constructors

DateTimeOffsetToBinaryConverter()

Creates a new instance of this converter.

public DateTimeOffsetToBinaryConverter()

Remarks

See EF Core value converters for more information and examples.

DateTimeOffsetToBinaryConverter(ConverterMappingHints?)

Creates a new instance of this converter.

public DateTimeOffsetToBinaryConverter(ConverterMappingHints? mappingHints)

Parameters

mappingHints ConverterMappingHints

Hints that can be used by the ITypeMappingSource to create data types with appropriate facets for the converted data.

Remarks

See EF Core value converters for more information and examples.

Properties

DefaultInfo

A ValueConverterInfo for the default use of this converter.

public static ValueConverterInfo DefaultInfo { get; }

Property Value

ValueConverterInfo

Methods

ToDateTimeOffset(long)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

[EntityFrameworkInternal]
public static DateTimeOffset ToDateTimeOffset(long v)

Parameters

v long

Returns

DateTimeOffset

ToLong(DateTimeOffset)

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

[EntityFrameworkInternal]
public static long ToLong(DateTimeOffset v)

Parameters

v DateTimeOffset

Returns

long