We have a model generated using VS 2019 with DotConnect 9.7.770.0 that we are using in an application using DotConnect 9.3.230.0 with EntityFrameworkCore 1.1.1 and we are getting the following error:
---
Unable to determine the relationship represented by navigation property '<NavigationProperty>' of type '<T>'. Either manually configure the relationship, or ignore this property from the model.
---
It seems that the model generated by 9.7.770.0 contains a .IsRequired(false) on navigation properties where it didn't before when generated with by earlier versions, as revealed by git. Some properties had .IsRequired(true) but those seem to be the existing.
I was able to get it to work if I were to manually edit the generated model and globally replace all/delete the .IsRequired(false), but I feel that is potentially too destructive. Another way I was able to get part of it to work is by setting Is Null to false on the Foreign Key on the class with the navigation property, but the problem is that 1) is not always the case and 2) there are a lot existing connections across multiple models.
I was trying to find some settings or attributes that modify this model generation behavior but to no avail. Is there something I may be missing? Is it a bug? Can it be addressed? Suggestions? Pointers?
Some information for potential questions. We want to start using VS 2019 but 9.3.230 doesn't have support for VS 2019, only 9.7.770.0. Also, 9.7.770.0 doesn't seem to support or work with EntityFrameworkCore 1.x.x, only EntityFrameworkCore 2.x.x. We are not ready to upgrade our projects to EntityFrameworkCore 2.x.x as would require more resources and testing that we cannot do right now, but also not a decision for me to make.
model generation issue
Re: model generation issue
Refer to https://www.devart.com/dotconnect/oracl ... story.html :
9.4.314 13-Jul-17
The behaviour is changed: IsRequired(false / true) for navigation properties is always generated in EF Core fluent mapping now
9.4.314 13-Jul-17
The behaviour is changed: IsRequired(false / true) for navigation properties is always generated in EF Core fluent mapping now
Please contact us and provide a small test project for reproducing the error in our environment.