Replies: 1 comment 1 reply
-
This looks like an EF question. You're asking which methods can be used by the EF provider to achieve this:
e.g. _languageRepository.Queryable().Select
(
l => new LanguageDto
{
CreatedTime = SqlFunctions.OperationEFCanTransalate(l.CreatedTime)
}
); I think whatever works here should work with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm developing a small project use postgresql, automapper, and odata.
I have entity:
and dto:
LanguageProfile:
ProjectTo:
And this code return DateTimeOffSet format is: "2021-08-12T17:25:14.359611Z" I want return: "2021-08-12T17:25:14.xxZ"
I have tried 2 way:
Truncate method:
and Profile:
or
But when user send OrderBy this way cann't translate Truncate method.
The LINQ expression 'DbSet<LanguageReadModel>()\n .OrderBy(l => l.CreatedTime\n .Truncate(00:00:01))' could not be translate
I use UseAsDataSource and OnEnumerated to map properties as:
This working with orderBy but not working with expand query.
What can i do that?
Microsoft.AspNetCore.OData (8.0.1)
AutoMapper: (10.1.1)
AutoMapper.Extensions.ExpressionMapping: (4.1.1)
Thanks for your support.
Beta Was this translation helpful? Give feedback.
All reactions