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

Cosmos: Modelvalidator fails when base type uses NotMapped attribute #16630

Closed
smitpatel opened this issue Jul 17, 2019 · 0 comments
Closed

Cosmos: Modelvalidator fails when base type uses NotMapped attribute #16630

smitpatel opened this issue Jul 17, 2019 · 0 comments
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

System.AggregateException : One or more errors occurred. (The property 'Orders' cannot be ignored on entity type 'Branch', because it's declared on the base entity type 'OwnedPerson'. To exclude this property from your model, use NotMappedAttribute or Ignore method on the base type.) (The following constructor parameters did not have matching fixture data: OwnedQueryCosmosFixture fixture)\n---- System.InvalidOperationException : The property 'Orders' cannot be ignored on entity type 'Branch', because it's declared on the base entity type 'OwnedPerson'. To exclude this property from your model, use NotMappedAttribute or Ignore method on the base type.\n---- The following constructor parameters did not have matching fixture data: OwnedQueryCosmosFixture fixture
----- Inner Stack Trace #1 (System.InvalidOperationException) -----
   at Microsoft.EntityFrameworkCore.Infrastructure.ModelValidator.ValidateIgnoredMembers(IModel model, IDiagnosticsLogger`1 logger) in /_/src/EFCore/Infrastructure/ModelValidator.cs:line 258
   at Microsoft.EntityFrameworkCore.Infrastructure.ModelValidator.Validate(IModel model, IDiagnosticsLogger`1 logger) in /_/src/EFCore/Infrastructure/ModelValidator.cs:line 60
   at Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.CosmosModelValidator.Validate(IModel model, IDiagnosticsLogger`1 logger) in /_/src/EFCore.Cosmos/Infrastructure/CosmosModelValidator.cs:line 31
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.ValidatingConvention.ProcessModelFinalized(IConventionModelBuilder modelBuilder, IConventionContext`1 context) in /_/src/EFCore/Metadata/Conventions/ValidatingConvention.cs:line 35
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ImmediateConventionScope.OnModelFinalized(IConventionModelBuilder modelBuilder) in /_/src/EFCore/Metadata/Conventions/Internal/ConventionNode.cs:line 372
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnModelFinalized(IConventionModelBuilder modelBuilder) in /_/src/EFCore/Metadata/Conventions/Internal/ConventionDispatcher.cs:line 54
   at Microsoft.EntityFrameworkCore.Metadata.Internal.Model.FinalizeModel() in /_/src/EFCore/Metadata/Internal/Model.cs:line 845
   at Microsoft.EntityFrameworkCore.ModelBuilder.FinalizeModel() in /_/src/EFCore/ModelBuilder.cs:line 494
   at Microsoft.EntityFrameworkCore.TestUtilities.TestModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder) in /_/test/EFCore.Specification.Tests/TestUtilities/TestModelSource.cs:line 32
   at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.<>c__DisplayClass5_0.<GetModel>b__1() in /_/src/EFCore/Infrastructure/ModelSource.cs:line 65
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.get_Value()
   at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.GetModel(DbContext context, IConventionSetBuilder conventionSetBuilder) in /_/src/EFCore/Infrastructure/ModelSource.cs:line 61
   at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel() in /_/src/EFCore/Internal/DbContextServices.cs:line 84
   at Microsoft.EntityFrameworkCore.Internal.DbContextServices.get_Model() in /_/src/EFCore/Internal/DbContextServices.cs:line 109
   at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.<>c.<TryAddCoreServices>b__7_3(IServiceProvider p) in /_/src/EFCore/Infrastructure/EntityFrameworkServicesBuilder.cs:line 247

Model
https://github.com/aspnet/EntityFrameworkCore/blob/52848421c2f27e0f32d1eb45b51c9cb7bbba98be/test/EFCore.Specification.Tests/Query/OwnedQueryTestBase.cs#L697-L726

@ajcvickers ajcvickers added this to the 3.0.0 milestone Jul 19, 2019
AndriySvyryd added a commit that referenced this issue Jul 31, 2019
@AndriySvyryd AndriySvyryd removed their assignment Jul 31, 2019
@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 Jul 31, 2019
AndriySvyryd added a commit that referenced this issue Aug 1, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0, 3.0.0-preview9 Aug 21, 2019
@ajcvickers ajcvickers modified the milestones: 3.0.0-preview9, 3.0.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