Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

NumberToBytesConverter<TNumber> Class

Definition

Namespace:
Microsoft.EntityFrameworkCore.Storage.ValueConversion
Assembly:
Microsoft.EntityFrameworkCore.dll
Package:
Microsoft.EntityFrameworkCore v10.0.0
Package:
Microsoft.EntityFrameworkCore v2.1.11
Package:
Microsoft.EntityFrameworkCore v2.2.6
Package:
Microsoft.EntityFrameworkCore v3.0.0
Package:
Microsoft.EntityFrameworkCore v3.1.0
Package:
Microsoft.EntityFrameworkCore v5.0.0
Package:
Microsoft.EntityFrameworkCore v6.0.0
Package:
Microsoft.EntityFrameworkCore v7.0.0
Package:
Microsoft.EntityFrameworkCore v8.0.0
Package:
Microsoft.EntityFrameworkCore v9.0.0
Source:
NumberToBytesConverter.cs
Source:
NumberToBytesConverter.cs
Source:
NumberToBytesConverter.cs
Source:
NumberToBytesConverter.cs
Source:
NumberToBytesConverter.cs
Source:
NumberToBytesConverter.cs
Source:
NumberToBytesConverter.cs
Source:
NumberToBytesConverter.cs
Source:
NumberToBytesConverter.cs
Source:
NumberToBytesConverter.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Converts numeric values to and from arrays of bytes.

[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1, 1 })]
public class NumberToBytesConverter<TNumber> : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter<TNumber,byte[]>
public class NumberToBytesConverter<TNumber> : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter<TNumber,byte[]>
[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1, 1 })>]
type NumberToBytesConverter<'Number> = class
 inherit ValueConverter<'Number, byte[]>
type NumberToBytesConverter<'Number> = class
 inherit ValueConverter<'Number, byte[]>
Public Class NumberToBytesConverter(Of TNumber)
Inherits ValueConverter(Of TNumber, Byte())

Type Parameters

TNumber
Inheritance
ValueConverter<TNumber,Byte[]>
NumberToBytesConverter<TNumber>
Attributes

Remarks

See EF Core value converters for more information and examples.

Constructors

Name Description
NumberToBytesConverter<TNumber>()

Creates a new instance of this converter.

NumberToBytesConverter<TNumber>(ConverterMappingHints)

Creates a new instance of this converter.

Properties

Name Description
ConstructorExpression

The expression representing construction of this object.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertFromProvider

Gets the function to convert objects when reading data from the store, setup to handle nulls, boxing, and non-exact matches of simple types.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertFromProviderExpression

Gets the expression to convert objects when reading data from the store, exactly as supplied and may not handle nulls, boxing, and non-exact matches of simple types.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertFromProviderTyped

Gets the function to convert objects when reading data from the store.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertsNulls

If true, then the nulls will be passed to the converter for conversion. Otherwise null values always remain null.

(Inherited from ValueConverter)
ConvertToProvider

Gets the function to convert objects when writing data to the store, setup to handle nulls, boxing, and non-exact matches of simple types.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertToProviderExpression

Gets the expression to convert objects when writing data to the store, exactly as supplied and may not handle nulls, boxing, and non-exact matches of simple types.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertToProviderTyped

Gets the function to convert objects when writing data to the store.

(Inherited from ValueConverter<TModel,TProvider>)
DefaultInfo

A ValueConverterInfo for the default use of this converter.

MappingHints

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

(Inherited from ValueConverter)
ModelClrType

The CLR type used in the EF model.

(Inherited from ValueConverter<TModel,TProvider>)
ProviderClrType

The CLR type used when reading and writing from the store.

(Inherited from ValueConverter<TModel,TProvider>)

Methods

Name Description
BytesToDecimal(Byte[])

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.

ComposeWith(ValueConverter)

Composes another ValueConverter instance with this one such that the result of the first conversion is used as the input to the second conversion.

(Inherited from ValueConverter)
DecimalToBytes(Decimal)

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.

ReverseInt(Byte[])

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.

ReverseLong(Byte[])

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.

ReverseShort(Byte[])

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.

ToBytes()

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.

ToNumber()

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.

Applies to


Feedback

Was this page helpful?