Note that there are some explanatory texts on larger screens.

plurals
  1. POPassing the interface of a class throws errors but passing just the class works fine
    primarykey
    data
    text
    <p>I have two classes:</p> <p>DefectsController</p> <pre><code>public abstract class DefectsController&lt;TDefect, TDefectService&gt; : ApplicationController&lt;DefectsController&lt;TDefect, TDefectService&gt;, TDefect&gt; where TDefectService : IEntityService&lt;TDefect&gt; where TDefect : Defect { private readonly TDefectService defectService; public DefectsController(TDefectService defectService) : base(defectService) { this.defectService = defectService; } } </code></pre> <p>and JobDefectsController (there are other parts as well, these are just examples)</p> <pre><code>public class JobDefectsController : DefectsController&lt;JobDefect, IEntityService&lt;JobDefect&gt;&gt; { public JobDefectsController(EntityService&lt;JobDefect&gt; service) : base(service) { } } </code></pre> <p>For some reason if I change JobDefectsController's constructor to using IEntityService instead then if I try to access <code>defectService</code> in the DefectsController it throws unknown errors.</p> <p>Edit: This error: The number of generic arguments provided doesn't equal the arity of the generic type definition.<br> Parameter name: instantiation</p> <p>There used to be a class called <code>JobDefectsService</code> which inherited from <code>IEntityService&lt;JobDefect&gt;</code> and the interface of that (<code>IJobDefectService</code>) could be used in place of both <code>IEntityService&lt;JobDefect&gt;</code> and <code>EntityService&lt;JobDefect&gt;</code> without problems.</p> <p>Anyone have any clue to what the problem could be?</p> <p>Thanks,<br> Harold</p>
    singulars
    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