Note that there are some explanatory texts on larger screens.

plurals
  1. POEntity Framework NullReferenceException during model creation
    primarykey
    data
    text
    <p>I am currently working on a project as a noob when it comes to WCF\EF, using entities\tables created by another developer. I am usually pretty quick at catching up on new things, and I have the small basics down on how to use the datacontext to do your work in the application. My only problem is that the context created by the other developer don't seem to be working, and I am unsure if the problem is with the model, the mappings, or the table. </p> <p>Here is the basic premise of the project.. The developer created the database first, and then POCO objects with EF mappings for those objects, to the tables. He did this to ensure ease of upgrade later on with newer columns\tables. On the creation of the model, the mappings are substituted instead of EF's mappings by overriding the OnModelCreating event, and adding the mappings to the model builder for each of the objects. Then the next thing that seems to happen after this is a NullReferenceException:</p> <pre><code>at System.Data.Entity.ModelConfiguration.Configuration.Properties.Navigation.NavigationPropertyConfiguration.ValidateConsistency(NavigationPropertyConfiguration navigationPropertyConfiguration) at System.Data.Entity.ModelConfiguration.Configuration.Properties.Navigation.NavigationPropertyConfiguration.Configure(EdmNavigationProperty navigationProperty, EdmModel model, EntityTypeConfiguration entityTypeConfiguration) at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.ConfigureAssociations(EdmEntityType entityType, EdmModel model) at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.Configure(EdmEntityType entityType, EdmModel model) at System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.ConfigureEntities(EdmModel model) at System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo) at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection) at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext) at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input) at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() at System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable&lt;TResult&gt;.GetEnumerator() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) </code></pre> <p>My main problem is, I can't seem to find any information that would lead me to the cause of this by searching, as I can't seem to find other people that have had this problem in this particular method. I would include code snippets of the mappings\POCOs\usage, but I am under an NDA for this project, and I don't know to what extent that extends. My main problem is if someone can just tell me what area I should be looking at for the cause of this problem... POCO setup, Mappings setup, or Tables setup? Any help would be greatly appreciated! I have looked over all the code myself several times, but can't seem to spot anythings, so some focus would help. I will try to help with what I can.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload