Open Joaoalen98 opened 6 months ago
@Joaoalen98 the problem is that the .NET format strings accepted by DateTime.ToString() don't necessarily correspond to the ones that SQL Server FORMAT accepts; we've traditionally avoided adding translations where things don't correspond like that (though there have been some exceptions). A possibly better way is to add an EF.Functions.Format which corresponds exactly to SQL Server FORMAT.
When i use Datetime.ToString( ) to format date for group registers by MM/yyyy for example, it would be nice if EF could translate this for native SQL function FORMAT.
Simple example below:![imagem_2023-12-28_204416464](https://github.com/dotnet/efcore/assets/89602176/5f1cac76-69db-4d31-a288-2c376c7028f1)