Giter Site home page Giter Site logo

Comments (4)

ajcvickers avatar ajcvickers commented on June 10, 2024 3

Note for team: still repros on latest daily; not a regression.

from entityframework.docs.

maumar avatar maumar commented on June 10, 2024 1

Note: also repros for non-json owned entities

from entityframework.docs.

LunicLynx avatar LunicLynx commented on June 10, 2024 1

The example only works if MoreData was something (not null) at the time it was attached.

from entityframework.docs.

ajcvickers avatar ajcvickers commented on June 10, 2024

Note for triage: I investigated this more. If this was not an owned type, this would be the correct behavior. This is because, in effect, the MoreData navigation isn't loaded. What this should do for owned types depends on whether or not we allow optional owned types to be not loaded. From an aggregate perspective, not allowed them to be unloaded is fine. That is, we could assume that if the navigation is null, then the owned type does not exist in the database, as opposed to it just isn't loaded. From the perspective of how people actually use owned types, it may not be fine.

Given that we are unsure where owned types are going, I propose we do nothing here immediately.

It's also worth noting that this works:

myDbContext.Update(owner);
owner.Data.MoreData = null;
myDbContext.SaveChanges();

This is because in this case EF is tracking the entity when the nav is set to null, so EF correctly detects this as a delete.

from entityframework.docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.