Skip to content

SQL Server: translate dateOnly.ToDateTime(timeOnly) to DATETIMEFROMPARTS #35076

@IanKemp

Description

@IanKemp

As title.

Transform to

EF.Functions.DateTimeFromParts(
    dateOnly.Year, dateOnly.Month, dateOnly.Day,
    timeOnly.Hour, timeOnly.Minute, timeOnly.Second, timeOnly.Millisecond)

which would then translate (using the current mapping of EF.Functions.DateTimeFromParts) to the SQL

DATETIMEFROMPARTS(
    DATEPART(year, dateOnly), DATEPART(month, dateOnly), DATEPART(day, dateOnly),
    DATEPART(hour, timeOnly), DATEPART(minute, timeOnly), DATEPART(second, timeOnly), DATEPART(millisecond, timeOnly))

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions