Closed ganySA closed 5 years ago
The actual error that is thrown is: TypeError: newValue.getProperty is not a function
Can you confirm that expand is working?
The challenge was due to naming conventions in use when using dotnet-ef dbcontext Scaffold and Pluralizer.
The issue is with Bricelam.EntityFrameworkCore.Pluralizer. This library pluralizes the entities and this causes an issue with breeze - as breeze is not expecting the class to return a pluralized form for a navigation property.
Lets assume the object Clients which has a related property booking
Firstname Lastname Booking ----> Booking
When you call expand('Bookings') the server finds the right value and returns a list but when this arrives on the client there is no property Bookings and this causes it to fail.
When you remove the pluralizer you will call expand('Booking') when the server returns Booking this value maps correctly to the breeze local entity Booking.
This also happens in .net 3.0 however you cannot remove the pluralizer as at this point in time so you cannot use .net 3.0.
I am leaving this open for comment.
We are using .expand
successfully in .NET Core 2.2 using the Bricelam.EntityFrameworkCore.Pluralizer.
Are you expanding 1-to-many relationships, or 1-to-1?
This was an issue with .net core 3.
Hi
I have successfully gotten most of the breeze working with .net core entity framework + .net core 3.0.
I experienced a few issues with naming conventions on the server and client side but those seem to have resolved.
One issue i am experiencing is with .expand("relatedEntityName"). I can see the data flowing back correctly from the .net core server but it causes an error.
This does not seem to work at all and causes the
ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'entityState' of undefined
When i debug it - it looks like the related entity - entity aspect is empty...