Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ There are two ways to remove an assembly from the global assembly cache (GAC):

At the command prompt, type the following command:

**gacutil u** \<*assembly name*>
**gacutil -u** \<*assembly name*>

In this command, *assembly name* is the name of the assembly to remove from the global assembly cache.

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/configure-apps/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ This article describes the syntax of configuration files and provides informatio

The name and location of the application configuration file depend on the app's host, which can be one of the following:

- Executablehosted app.
- Executable-hosted app.

These apps have two configuration files: a source configuration file, which is modified by the developer during development, and an output file that's distributed with the app.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ DATETIMEOFFSET'2006-12-25 01:01:00.0000000 -08:30'
Binary'00ffaabb'
X'ABCabc'
BINARY '0f0f0f0F0F0F0F0F0F0F'
X'' - empty binary string
X'' -- empty binary string
```

## Guid
Expand Down
72 changes: 36 additions & 36 deletions docs/framework/data/adonet/sql/linq/system-datetime-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ ms.assetid: 4f80700c-e83f-4ab6-af0f-1c9a606e1133
---
# System.DateTime Methods

The following LINQ to SQL-supported methods, operators, and properties are available to use in LINQ to SQL queries. When a method, operator or property is unsupported, LINQ to SQL cannot translate the member for execution on the SQL Server. You may use these members in your code, however, they must be evaluated before the query is translated to Transact-SQL or after the results have been retrieved from the database.
## Supported System.DateTime Members

Once mapped in the object model or external mapping file, LINQ to SQL allows you to call the following <xref:System.DateTime?displayProperty=nameWithType> members inside LINQ to SQL queries.
|Supported <xref:System.DateTime> Methods|Supported <xref:System.DateTime> Operators|Supported <xref:System.DateTime> Properties|
|-|-|-|
|<xref:System.DateTime.Add%2A>|<xref:System.DateTime.op_Addition%2A>|<xref:System.DateTime.Date%2A>|
|<xref:System.DateTime.AddDays%2A>|<xref:System.DateTime.op_Equality%2A>|<xref:System.DateTime.Day%2A>|
|<xref:System.DateTime.AddHours%2A>|<xref:System.DateTime.op_GreaterThan%2A>|<xref:System.DateTime.DayOfWeek%2A>|
|<xref:System.DateTime.AddMilliseconds%2A>|<xref:System.DateTime.op_GreaterThanOrEqual%2A>|<xref:System.DateTime.DayOfYear%2A>|
|<xref:System.DateTime.AddMinutes%2A>|<xref:System.DateTime.op_Inequality%2A>|<xref:System.DateTime.Hour%2A>|
|<xref:System.DateTime.AddMonths%2A>|<xref:System.DateTime.op_LessThan%2A>|<xref:System.DateTime.Millisecond%2A>|
|<xref:System.DateTime.AddSeconds%2A>|<xref:System.DateTime.op_LessThanOrEqual%2A>|<xref:System.DateTime.Minute%2A>|
|<xref:System.DateTime.AddTicks%2A>|<xref:System.DateTime.op_Subtraction%2A>|<xref:System.DateTime.Month%2A>|
|<xref:System.DateTime.AddYears%2A>||<xref:System.DateTime.Now%2A>|
|<xref:System.DateTime.Compare%2A>||<xref:System.DateTime.Second%2A>|
|<xref:System.DateTime.CompareTo%28System.DateTime%29>||<xref:System.DateTime.TimeOfDay%2A>|
|<xref:System.DateTime.Equals%28System.DateTime%29>||<xref:System.DateTime.Today%2A>|
|||<xref:System.DateTime.Year%2A>|
## Members Not Supported by LINQ to SQL
The following LINQ to SQL-supported methods, operators, and properties are available to use in LINQ to SQL queries. When a method, operator or property is unsupported, LINQ to SQL cannot translate the member for execution on the SQL Server. You may use these members in your code, however, they must be evaluated before the query is translated to Transact-SQL or after the results have been retrieved from the database.

## Supported System.DateTime Members

Once mapped in the object model or external mapping file, LINQ to SQL allows you to call the following <xref:System.DateTime?displayProperty=nameWithType> members inside LINQ to SQL queries.

|Supported <xref:System.DateTime> Methods|Supported <xref:System.DateTime> Operators|Supported <xref:System.DateTime> Properties|
|-|-|-|
|<xref:System.DateTime.Add%2A>|<xref:System.DateTime.op_Addition%2A>|<xref:System.DateTime.Date%2A>|
|<xref:System.DateTime.AddDays%2A>|<xref:System.DateTime.op_Equality%2A>|<xref:System.DateTime.Day%2A>|
|<xref:System.DateTime.AddHours%2A>|<xref:System.DateTime.op_GreaterThan%2A>|<xref:System.DateTime.DayOfWeek%2A>|
|<xref:System.DateTime.AddMilliseconds%2A>|<xref:System.DateTime.op_GreaterThanOrEqual%2A>|<xref:System.DateTime.DayOfYear%2A>|
|<xref:System.DateTime.AddMinutes%2A>|<xref:System.DateTime.op_Inequality%2A>|<xref:System.DateTime.Hour%2A>|
|<xref:System.DateTime.AddMonths%2A>|<xref:System.DateTime.op_LessThan%2A>|<xref:System.DateTime.Millisecond%2A>|
|<xref:System.DateTime.AddSeconds%2A>|<xref:System.DateTime.op_LessThanOrEqual%2A>|<xref:System.DateTime.Minute%2A>|
|<xref:System.DateTime.AddTicks%2A>|<xref:System.DateTime.op_Subtraction%2A>|<xref:System.DateTime.Month%2A>|
|<xref:System.DateTime.AddYears%2A>||<xref:System.DateTime.Now%2A>|
|<xref:System.DateTime.Compare%2A>||<xref:System.DateTime.Second%2A>|
|<xref:System.DateTime.CompareTo%28System.DateTime%29>||<xref:System.DateTime.TimeOfDay%2A>|
|<xref:System.DateTime.Equals%28System.DateTime%29>||<xref:System.DateTime.Today%2A>|
|||<xref:System.DateTime.Year%2A>|

## Members Not Supported by LINQ to SQL

The following members are not supported inside LINQ to SQL queries:

Expand All @@ -50,18 +50,18 @@ The following LINQ to SQL-supported methods, operators, and properties are avail
- <xref:System.DateTime.FromFileTimeUtc%2A>
- <xref:System.DateTime.FromOADate%2A>
- <xref:System.DateTime.GetDateTimeFormats%2A>
## Method Translation Example

All methods supported by LINQ to SQL are translated to Transact-SQL before they are sent to SQL Server. For example, consider the following pattern.
`(dateTime1 dateTime2).{Days, Hours, Milliseconds, Minutes, Months, Seconds, Years}`
When it is recognized, it is translated into a direct call to the SQL Server `DATEDIFF` function, as follows:
`DATEDIFF({DatePart}, @dateTime1, @dateTime2)`
## SQLMethods Date and Time Methods

## Method Translation Example

All methods supported by LINQ to SQL are translated to Transact-SQL before they are sent to SQL Server. For example, consider the following pattern.

`(dateTime1 - dateTime2).{Days, Hours, Milliseconds, Minutes, Months, Seconds, Years}`

When it is recognized, it is translated into a direct call to the SQL Server `DATEDIFF` function, as follows:

`DATEDIFF({DatePart}, @dateTime1, @dateTime2)`

## SQLMethods Date and Time Methods

In addition to the methods offered by the <xref:System.DateTime> structure, LINQ to SQL offers the following methods from the <xref:System.Data.Linq.SqlClient.SqlMethods?displayProperty=nameWithType> class for working with date and time:

Expand All @@ -74,7 +74,7 @@ The following LINQ to SQL-supported methods, operators, and properties are avail
- <xref:System.Data.Linq.SqlClient.SqlMethods.DateDiffMicrosecond%2A>
- <xref:System.Data.Linq.SqlClient.SqlMethods.DateDiffMonth%2A>
- <xref:System.Data.Linq.SqlClient.SqlMethods.DateDiffYear%2A>

## See also

- [Query Concepts](query-concepts.md)
Expand Down
Loading
Loading