I my case I want to store an address but it has to be optional.
My mapping lookes like this:
map.OwnsOne(x => x.Address, cb => cb.OwnsOne(l => l.Location));
But when comitting my DbContext with Address as null iam getting this error:
InvalidOperationException: The entity of 'Member' is sharing the table 'Members' with 'Member.Address#StreetAddress', but there is no entity of this type with the same key value 'Id:-2147480644' that has been marked as 'Added'.
I then instantiated the Address and Location from the constructors, and now I can save the entity. But when fetching the data again I also gets an instantiated Address, where i really wanted a null value.
Is it not possible to make nullable Owned Types ?