title: EF Core Object properties are empty after making them private
body: <p>I'm building an application in ASP.Net Core with EF Core and an Object <code>Article</code> that contains some price-fields (mapped to a db) that may not be accessible directly. Using a nested object PriceSet, the field must be accessible This are the objects:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Article{
      public string ArticleId { get; set; }
      public string Name { get; set; }
      public decimal PriceInclVAT { get; set; }
      public decimal PriceExclVAT { get; set; }
      public decimal FromPriceInclVAT { get; set; }
      public decimal FromPriceExclVAT { get; set; }
  
      public PriceSet Prices{
          get{
              return new PriceSet(PriceInclVAT, PriceExclVAT, FromPriceInclVAT, FromPriceExclVAT);
          }
      }
  }
  
  public class PriceSet{
      private decimal _priceInclVAT { get; set; }
      private decimal _priceExclVAT { get; set; }
      private decimal _fromPriceInclVAT { get; set; }
      private decimal _fromPriceExclVAT { get; set; }
  
      public PriceSet(decimal PriceInclVAT, decimal PriceExclVAT, decimal FromPriceInclVAT, decimal FromPriceExclVAT){
          _priceInclVAT = PriceInclVAT;
          _priceExclVAT = PriceExclVAT;
          _fromPriceInclVAT = FromPriceInclVAT;
          _fromPriceExclVAT = FromPriceExclVAT;
      }
  
      public GetPrice(bool includeVAT){
          return includeVAT ? _priceInclVAT : _priceExclVAT;
      }
  }
  </code></pre>
  <p>The object <code>PriceSet</code> will be used for multiple object that contain prices. As said, I want to set the decimal price-fields of <code>Article</code> to be non-accessible directly, so I tried setting them to private:</p>
  <pre class="lang-cs prettyprint-override"><code>public class Article{
      public string ArticleId { get; set; }
      public string Name { get; set; }
      private decimal PriceInclVAT { get; set; }
      private decimal PriceExclVAT { get; set; }
      private decimal FromPriceInclVAT { get; set; }
      private decimal FromPriceExclVAT { get; set; }
  
      public PriceSet Prices{
          get{
              return new PriceSet(PriceInclVAT, PriceExclVAT, FromPriceInclVAT, FromPriceExclVAT);
          }
      }
  }
  </code></pre>
  <p>But now the values aren't filled with the data from the database.</p>
  <p>The data is filled with my DbContext:</p>
  <pre class="lang-cs prettyprint-override"><code>modelBuilder.Entity&lt;Article&gt;(entity =&gt;
  {
      entity.HasKey(e =&gt; e.ArticleId);
      entity.ToTable(&quot;ARTICLE&quot;);
  
      entity.Property(e =&gt; e.ArticleId);
      entity.Property(e =&gt; e.Name)
          .HasMaxLength(64)
          .IsUnicode(false);
      entity.Property(e =&gt; e.PriceInclVAT).HasColumnType(&quot;decimal(18, 4)&quot;);
      entity.Property(e =&gt; e.PriceExclVAT).HasColumnType(&quot;decimal(18, 4)&quot;);
      entity.Property(e =&gt; e.FromPriceInclVAT).HasColumnType(&quot;decimal(18, 4)&quot;);
      entity.Property(e =&gt; e.FromPriceExclVAT).HasColumnType(&quot;decimal(18, 4)&quot;);
  });
  </code></pre>
  <p>What am I doing wrong, or what do I need to do to achieve my goal?</p>