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

Metadata: Exception is not thrown for unmapped navigation property #9396

Closed
smitpatel opened this issue Aug 12, 2017 · 1 comment
Closed
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

@smitpatel
Copy link
Member

Model

public class User
{
    public ICollection<Warn> Warns { get; set; }
    public int Id { get; set; }
}

public class Warn
{
    public int Id { get; set; }
    public string Reason { get; set; }
    public DateTime Timestamp { get; set; }
    public User Moderator { get; set; }
    public User User { get; set; }
}

//OnModelCreating
modelBuilder.Entity<User>();

Generates schema

      CREATE TABLE [User] (
          [Id] int NOT NULL IDENTITY,
          CONSTRAINT [PK_User] PRIMARY KEY ([Id])
      );

Since there are 2 inverse navigation we cannot find out relationship by convention hence we don't discover Warn entity type. But we don't throw for unmapped User.Warns
Not a regression

@ajcvickers ajcvickers added this to the 2.1.0 milestone Aug 14, 2017
@ajcvickers ajcvickers modified the milestones: 2.1.0-preview1, 2.1.0 Jan 17, 2018
@AndriySvyryd
Copy link
Member

Fixed in e7ba1a4

@AndriySvyryd AndriySvyryd removed their assignment Feb 10, 2018
@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 Feb 10, 2018
@ajcvickers ajcvickers modified the milestones: 2.1.0-preview2, 2.1.0 Nov 11, 2019
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

3 participants