Note that there are some explanatory texts on larger screens.

plurals
  1. POError in LINQ when work with PostGreSQL by Entity Framework
    text
    copied!<p>I have a problem with LINQ query. Here this:</p> <pre><code>List&lt;a&gt; get = (from i in entitiesFactory.subsDbContext.a where i.id == id select i).ToList&lt;a&gt;(); </code></pre> <p>The model look like this"</p> <pre><code>public partial class a { [Key] public int id { get; set; } [ForeignKey("contractors"), Column(Order = 0)] public Nullable&lt;int&gt; ot_contractor_id { get; set; } [ForeignKey("contractors1"), Column(Order = 1)] public Nullable&lt;int&gt; gvo_contractor_id { get; set; } public virtual contractors contractors { get; set; } public virtual contractors contractors1 { get; set; } } </code></pre> <p>Table a look like this:</p> <pre><code>CREATE TABLE a ( id serial NOT NULL, ot_contractor_id integer, gvo_contractor_id integer, CONSTRAINT a_pkey PRIMARY KEY (nzp_thgf_det), CONSTRAINT a_gvo_contractor_id_fkey FOREIGN KEY (gvo_contractor_id) REFERENCES contractors (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT a_ot_contractor_id_fkey FOREIGN KEY (ot_contractor_id) REFERENCES contractors (id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, ) </code></pre> <p>So, table 'a' have 2 references to other table 'contractors'. </p> <pre><code>[a].[ot_contractor_id] ---&gt; [contractors].[id] </code></pre> <p>and </p> <pre><code>[a].[gvo_contractor_id] ---&gt; [contractors].[id]. </code></pre> <p>The problem is: LINQ query has fallen when it try to execute.</p> <p>ERROR: <code>The column Extent1.contractors_id does not exist</code>.</p>
 

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