Open fmclopes opened 9 months ago
The comparison by name fixes issues #149 and #152. We could still check for FullName if there's more than result. Maybe:
IEdmEntityType GetEntity()
{
List<IEdmEntityType> entities = context.Model.SchemaElements.OfType<IEdmEntityType>().Where(e => e.Name == type.Name).ToList();
if (entities.Count == 1)
return entities[0];
if (entities.Count > 1)
return entities.FirstOrDefault(e => e.FullName() == type.FullName);
return null;
}
or whatever works for the full name comparison.
PRs are welcome.
Hello,
I have find a problem when using the method GetQueryAsync. When I use this method give the error "The type 'Module1.CountryDto' has not been declared in the entity data model."
I have a EDM Model with 2 Dto with the same name but in different modules:
The method FindSortableProperties have a function called GetEntity the find by name, but I think it should be by full name. In my case the entities.Count will give 2 and will return null.
Note: when i use $orderBy it work because not call the method FindSortableProperties.
Version
AutoMapper.AspNetCore.OData.EFCore 4.0.0
Expected behavior
No error.
Actual behavior
Request results in status code 500 Internal Server Error with argument exception: