title: Unable to access model properties of database context - .net core (3.1)
body: <p>I'm new to .net core and currently stuck in very odd and unfamiliar situation.
  Let me explain you my problem in steps:  </p>
  
  <p><strong>Step 1</strong>
  First I created basic models</p>
  
  <pre><code>    [Table("ApplicationUserRights", Schema = "Security")]
      public class ApplicationUserRight
      {
          public Guid RoleId { get; set; }
          public int MenuId { get; set; }
          public int ClaimId { get; set; }
  
          [ForeignKey("RoleId")]
          public virtual ICollection&lt;ApplicationRole&gt; ApplicationRoles { get; set; }
  
          [ForeignKey("MenuId")]
          public virtual ICollection&lt;ApplicationMenu&gt; ApplicationMenus { get; set; }
  
          [ForeignKey("ClaimId")]
          public virtual ICollection&lt;ApplicationClaim&gt; ApplicationClaims { get; set; }
      }
  
      [Table("ApplicationClaim", Schema = "Security")]
      public class ApplicationClaim
      {
          [Required]
          [Key]
          [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
          public int Id { get; set; }
          [MaxLength(100)]
          public string Claim { get; set; }
          public int EnumValue { get; set; }
      }
  
  
  </code></pre>
  
  <p><strong>Step 2</strong><br>
  Then I created my database context something like this.</p>
  
  <pre><code>public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser, ApplicationRole, Guid, 
          ApplicationUserClaim, ApplicationUserRole, ApplicationUserLogin, ApplicationRoleClaim, ApplicationUserToken&gt;
      {
        public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options)
              : base(options)
          {
          }
          ....
  
          public DbSet&lt;ApplicationClaim&gt; ApplicationClaims { get; set; }
          public DbSet&lt;ApplicationUserRight&gt; ApplicationUserRights { get; set; }
  
          ....
      }
  </code></pre>
  
  <p><strong>Step 3:</strong><br>
  Registered that database context in startup.cs.</p>
  
  <pre><code>services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
                  options.UseSqlServer(
                      Configuration.GetConnectionString("DefaultConnection")));
  
  services.AddDefaultIdentity&lt;ApplicationUser&gt;();
  </code></pre>
  
  <p><strong>Step: 4</strong><br>
  Scoped a class on which database context will work.</p>
  
  <pre><code>...
  services.AddScoped&lt;IMiddlewareAuthorization, MiddlewareAuthorization&gt;();
  ...
  </code></pre>
  
  <p><strong>Step: 5</strong>
  Finally when I try to make a linq query, properties just won't show up</p>
  
  <pre><code>public class MiddlewareAuthorization : IMiddlewareAuthorization
      {
          private readonly ApplicationDbContext db;
          public MiddlewareAuthorization(ApplicationDbContext context) 
          {
              db = context;
          }
          public IList&lt;string&gt; GetAuthorizedURLs()
          {
              var Urls = (from abc in db.ApplicationUserRights
                          join xyz in db.ApplicationClaims on abc.??? equals xyz.???);
  
              return new List&lt;string&gt;();
          }
      }
  </code></pre>
  
  <p>That is very frustrating to me cause I just cannot figure the actual cause of the problem.</p>