Note that there are some explanatory texts on larger screens.

plurals
  1. POEF 5, Fluent API : invalid column name "Source_ID"
    primarykey
    data
    text
    <p>Good morning</p> <p>I Get invalid column name "Source_ID". my models are :</p> <p>product:</p> <pre><code>public int ID { get; set; } public string Name { get; set; } public string Description { get; set; } public decimal Price { get; set; } public Nullable&lt;decimal&gt; PreviousPrice { get; set; } public string Url { get; set; } public int SourceID { get; set; } public int SectionID { get; set; } public int CategoryID { get; set; } public Nullable&lt;int&gt; BrandID { get; set; } public string PublisherProductID { get; set; } public string PictureFilename { get; set; } public bool Deleted { get; set; } public Nullable&lt;int&gt; Score { get; set; } public string EAN { get; set; } public string ExtraAttributes { get; set; } public DateTime LastUpdateDate { get; set; } public DateTime InsertDate { get; set; } public string Keywords { get; set; } public virtual ProductPicture ProductPicture { get; set; } public virtual Brand Brand { get; set; } public virtual Source Source { get; set; } public virtual Category Category { get; set; } public virtual Section Section { get; set; } public virtual ICollection&lt;ProductComment&gt; Comments { get; set; } public virtual ICollection&lt;Like&gt; Likes { get; set; } public virtual ICollection&lt;Aside&gt; Asides { get; set; } public virtual ICollection&lt;Wish&gt; Wishlists { get; set; } public virtual ICollection&lt;UserRecommendation&gt; UserRecommendations { get; set; } public virtual ICollection&lt;ProductColor&gt; ProductColors { get; set; } public virtual ICollection&lt;ProductView&gt; ProductViews { get; set; } public virtual ICollection&lt;PointLog&gt; PointLogs { get; set; } public virtual ICollection&lt;InvitationLog&gt; InvitationLogs { get; set; } public virtual ICollection&lt;FeedItem&gt; FeedItems { get; set; } public virtual ICollection&lt;Sale&gt; Sales { get; set; } public virtual ICollection&lt;ListProduct&gt; ListProducts { get; set; } public virtual ICollection&lt;BonusMalus&gt; BonusMalus { get; set; } public virtual ICollection&lt;ProductHunter&gt; Hunters { get; set; } </code></pre> <p>Product Mapping :</p> <pre><code>HasKey(e =&gt; e.ID); Property(e =&gt; e.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity); Property(e =&gt; e.Name).IsRequired().HasColumnType("VARCHAR").HasMaxLength(200); Property(e =&gt; e.Description).HasColumnType("VARCHAR").HasMaxLength(4000); Property(e =&gt; e.Price).IsRequired().HasColumnType("Money"); Property(e =&gt; e.PreviousPrice).IsOptional().HasColumnType("Money"); Property(e =&gt; e.ExtraAttributes).HasColumnType("VARCHAR").IsOptional().HasMaxLength(1000); Property(e =&gt; e.Url).IsRequired().HasColumnType("VARCHAR").HasMaxLength(2048); Property(e =&gt; e.LastUpdateDate).IsOptional(); Property(e =&gt; e.InsertDate).IsOptional(); Property(e =&gt; e.PictureFilename).HasColumnType("VARCHAR").HasMaxLength(200); Property(e =&gt; e.Deleted).IsRequired(); Property(e =&gt; e.EAN).IsOptional().HasColumnType("VARCHAR").HasMaxLength(18); Property(e =&gt; e.PublisherProductID).IsRequired().HasColumnType("VARCHAR").HasMaxLength(100); Property(e =&gt; e.BrandID).IsOptional(); Property(e =&gt; e.SourceID).IsRequired(); Property(e =&gt; e.Keywords).HasColumnType("VARCHAR").HasMaxLength(500); ToTable("Products"); HasOptional(t =&gt; t.Brand).WithMany(t =&gt; t.Products).HasForeignKey(d =&gt; d.BrandID); HasRequired(e =&gt; e.Source).WithMany(s =&gt; s.Products).HasForeignKey(e =&gt; e.SourceID); HasRequired(e =&gt; e.Category).WithMany(c =&gt; c.Products).HasForeignKey(e =&gt; e.CategoryID); HasRequired(t =&gt; t.Section).WithMany(t =&gt; t.Products).HasForeignKey(d =&gt; d.SectionID); </code></pre> <p>Source :</p> <pre><code>public int ID { get; set; } public string Name { get; set; } public virtual ICollection&lt;Product&gt; Products { get; set; } public virtual ICollection&lt;SourceCategory&gt; SourceCategories { get; set; } public virtual ICollection&lt;SourceCategoryRule&gt; SourceCategoryRules { get; set; } public virtual ICollection&lt;WishlistGame&gt; WishlistGames { get; set; } public virtual ICollection&lt;SourceWebsiteCommission&gt; Commissions { get; set; } public virtual ICollection&lt;Sale&gt; Sales { get; set; } </code></pre> <p>Source Mapping :</p> <pre><code>HasKey(e =&gt; e.ID); Property(e =&gt; e.ID).HasDatabaseGeneratedOption(DatabaseGeneratedOption.None); Property(e =&gt; e.Name).IsRequired().HasColumnType("VARCHAR").HasMaxLength(50); ToTable("Sources"); </code></pre> <p>The tables Products &amp; Sources are already created. when i run my solution i got this problem (invalid column name Source_ID). maybe it is an error in my mapping. Anyone have a solution ?</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.
    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