Skip to content
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

[CosmosDb] Child properties in inheritance hierarchy are not saved to CosmosDB #17660

Closed
NickSevens opened this issue Sep 6, 2019 · 1 comment

Comments

@NickSevens
Copy link

Steps to reproduce

I'm having a setup like for example:

public Context : DbContext {
  public DbSet<Animal> Animals { get; set; }
}

public class Animal {
  public string Color { get; set; }
}

public class Cat : Animal {
  public int Lives { get; set; }
}

public class Dog : Animal {
  public int Puppies { get; set; }
}

I am then adding a Cat and a Dog to my collection (_context.Animals.Add(new Dog() {...}); and _context.Animals.Add(new Cat() {...});

However, in the CosmosDb, the properties Color and Lives are not saved in the JSON document. Is there a way to allow this?

Thanks.

Further technical details

EF Core version: 3.0.0-preview9.19423.6
Database Provider: Microsoft.EntityFrameworkCore.Cosmos
Operating system: Windows 10
IDE: Visual Studio 2019

@AndriySvyryd
Copy link
Member

@NickSevens This is not Cosmos-specific, owned types do not support inheritance

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants