You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to offset indices for tests (which makes it more foolproof when incremental indices by accident exist yet point to a different type but the motivation is not that important) we have code that loops over the Entity Types.
foreach(var entityType in modelBuilder.Model.GetEntityTypes()){if(!ignored.Any(ign => entityType.Name.Contains(ign))){
method.MakeGenericMethod(entityType.ClrType).Invoke(null,newobject[]{ modelBuilder });}}
When moving to Dotnet6, we moved to to the following EF core version <PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.7" /> and noticed that there is a surprising entry in the result from 'GetEntityTypes'. Next to our models it now contains EntityType: List<List<string>> Keyless which does not satisfy our type constraints of the function we are calling. We can easily fix this code but I'm assuming you might want to be aware of it so decided to log it here. My apologies if this is intended behaviour.
Include stack traces
Stack trace is mainly our code so it won't help you and includes client details, the error is:
Error Message:
System.ArgumentException : GenericArguments[0], 'System.Collections.Generic.List`1[System.Collections.Generic.List`1[System.String]]', on 'Void Configure[TEntity](Microsoft.EntityFrameworkCore.ModelBuilder)' violates the constraint of type 'TEntity'.
---- System.Security.VerificationException : Method MraApi.Util.BaseEntityConfiguration.Configure: type argument 'System.Collections.Generic.List`1[System.Collections.Generic.List`1[System.String]]' violates the constraint of type parameter 'TEntity'.
Include provider and version information
EF Core version:6.0.7
Database provider: npgsql
Target framework: NET 6.0
Operating system: Manjaro
IDE: Rider
The text was updated successfully, but these errors were encountered:
@databrecht The model available while OnModelCreating is being run may not be the final model, since various conventions run while the model is being built and when it is finalized. This means the model during OnModelCreating can have configurations for types that don't end up as entity types in the final model.
#214, which is planned for 7.0, will allow greater access to the conventions, potentially providing a better method for what you are trying to do.
Include your code
In order to offset indices for tests (which makes it more foolproof when incremental indices by accident exist yet point to a different type but the motivation is not that important) we have code that loops over the Entity Types.
When moving to Dotnet6, we moved to to the following EF core version
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.7" />
and noticed that there is a surprising entry in the result from 'GetEntityTypes'. Next to our models it now containsEntityType: List<List<string>> Keyless
which does not satisfy our type constraints of the function we are calling. We can easily fix this code but I'm assuming you might want to be aware of it so decided to log it here. My apologies if this is intended behaviour.Include stack traces
Stack trace is mainly our code so it won't help you and includes client details, the error is:
Include provider and version information
EF Core version:6.0.7
Database provider: npgsql
Target framework: NET 6.0
Operating system: Manjaro
IDE: Rider
The text was updated successfully, but these errors were encountered: