-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow owned entities on a keyless entity type #17890
Comments
@aherrick - Can you elaborate more exactly what are you trying to achieve? What is the view definition and what part is causing issue? |
Let's pretend my view looked like the following:
I'd like to inflate this View into the |
@aherrick - That is not possible. In EF each entityType maps to one database object. Same database object can be used for multiple entityTypes but you cannot specify a database object to materialize a graph of object. If above was an aggregate root, there could have been more options but keyless entity types cannot act as one. |
Hmm Thanks... I was hoping I could do something similar to below so I could just manually map the fields.
|
@aherrick - I also thought that is probably what you intend. But keyless entities cannot be principal end of relationship hence they cannot have owned entities. |
Is there any reason why keyless entity cannot have owned type which origin is from the exactly same table? It would be very useful to be able simplify/reuse entity model for views or tables without primary key. |
+1 for ability to use |
+1 |
I have a simple view in my DB that is exposing some fields joined from multiple tables.
I'm able to map my view to my object similar to below:
MyDbView is an object similar to below.
Since the view has flattened the 2 Address fields into 6 fields (
OriginAddressName
,OriginAddressCity
, etc.), I'd like to inflate them back to the object soMyDbView
doesn't have to have a direct mapping to each of the fields and I can reuse my types.How is the possible?
The text was updated successfully, but these errors were encountered: