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

NotMapped on overridden mapped base class property on EF6 throws, but has no effect on EF Core #5864

Closed
ajcvickers opened this issue Jun 24, 2016 · 1 comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@ajcvickers
Copy link
Member

Model:

private abstract class AbstractBaseEntity4
{
    public long Id { get; set; }
    public abstract string AbstractBaseClassProperty { get; set; }
}

private class BaseEntity4 : AbstractBaseEntity4
{
    public string BaseClassProperty { get; set; }
    public virtual string VirtualBaseClassProperty { get; set; }
    public override string AbstractBaseClassProperty { get; set; }
}

private class Unit4 : BaseEntity4
{
    [NotMapped]
    public override string VirtualBaseClassProperty { get; set; }
    public virtual AbstractBaseEntity4 Related { get; set; }
}

Config:

modelBuilder.Entity<Unit4>();
modelBuilder.Entity<BaseEntity4>();

In EF6, this will throw. In EF Core, the NotMapped attribute is ignored and VirtualBaseClassProperty remains part of the model.

@rowanmiller
Copy link
Contributor

We think this should throw

@rowanmiller rowanmiller assigned AndriySvyryd and unassigned smitpatel Jul 1, 2016
@rowanmiller rowanmiller removed the pri0 label Jul 6, 2016
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 1, 2016
@AndriySvyryd AndriySvyryd removed their assignment Aug 1, 2016
@ajcvickers ajcvickers modified the milestones: 1.1.0-preview1, 1.1.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants