DbFunctionsExtensions.Random(DbFunctions) Method

Definition

A random double number generator which generates a number between 0 and 1, exclusive.

C#
public static double Random (this Microsoft.EntityFrameworkCore.DbFunctions _);

Parameters

_
DbFunctions

The DbFunctions instance.

Returns

A random double number between 0 and 1, exclusive.

Remarks

This DbFunction method has no in-memory implementation and will throw if the query switches to client-evaluation. This can happen if the query contains one or more expressions that could not be translated to the store.

Applies to

Product Versions
Entity Framework Core 6.0, 7.0, 8.0, 9.0