zzzprojects / GraphDiff

GraphDiff is a library that allows the automatic update of a detached graph using Entity Framework code first.
https://entityframework-graphdiff.net/overview
MIT License
333 stars 101 forks source link

Problem in inheritance with aggregation #175

Closed thiagorizzo closed 6 years ago

thiagorizzo commented 6 years ago

Hi, I got a scenario with inheritance like this one:

Parent Class

    public abstract class TypeBase
    {
    ...
    }

Child Class (1)

    public class TypeOne : TypeBase
    {
    ...
    }

Child Class (2) - With Aggregation

    public class TypeTwo: TypeBase
    {
    ...
    public virtual AnotherType ObjectAnotherType { get; set; }
    }

Class to persist

    public class MyClassToPersist
    {
    public virtual TypeBase ObjectTypeBase { get; set; }
    }

Persisting service

    MyClassToPersist obj = new MyClassToPersist { ... };

    ctx.UpdateGraph(obj, map => map
                    .OwnedEntity(o => o.ObjectTypeBase, with => with
                        .OwnedEntity(s => s.ObjectAnotherType)));

Its not working coz its saying theres no ObjectAnotherType in TypeBase. Is there anyway to make it work?

Thanx.

JonathanMagnan commented 6 years ago

Hello @thiagorizzo ,

Do you think you could provide us a test project with this issue?

It will make easier/faster for my developer to getting started for investigating it.

We now always ask for a project since we found out that most issues are missing some essential information or are resolved by the requestor when creating it

(Even if the issue seem very easy to reproduce, by getting a test project, it allow us to give a faster support and better experience for the support of all our free libraries)

Best Regards,

Jonathan

JonathanMagnan commented 6 years ago

Hello @thiagorizzo ,

This issue will be closed since we haven't heard back from you.

Feel free to reopen it if you can provide the information we asked.

Best Regards,

Jonathan