title: EF Core Configuring Complex Types
body: <p>I'm learning C# at the moment with .NET Core and EF Core for working with database.</p>
  <p>Now I'm at the point where I got stuck configuring my entities.</p>
  <p>I have written the following classes:</p>
  <pre><code>public class Customer
  {
      #region Properties
      public Guid CustomerID { get; set; }
      ...
      public Address Address { get; set; }
      #endregion
  
      public Customer()
      {
          Address = new Address();
      }
  }
  
  public class CustomerConfiguration : IEntityTypeConfiguration&lt;Customer&gt;
  {
      public void Configure(EntityTypeBuilder&lt;Customer&gt; builder)
      {
          //Primary Key
          builder.HasKey(c =&gt; c.CustomerID);
  
          //Complex Types
          builder.OwnsOne&lt;Address&gt;(&quot;Address&quot;);
      }
  }
  
  public class Employee
  {
      #region Properties
      public Guid EmployeeID { get; set; }
      ...
      public Address Address { get; set; }
      #endregion
  
      public Employee()
      {
          Address = new Address();
      }
  }
  
  public class EmployeeConfiguration : IEntityTypeConfiguration&lt;Employee&gt;
  {
      public void Configure(EntityTypeBuilder&lt;Employee&gt; builder)
      {
          //Primary Key
          builder.HasKey(c =&gt; c.EmployeeID);
  
          //Complex Types
          builder.OwnsOne&lt;Address&gt;(&quot;Address&quot;);
      }
  }
  
  public class Address
  {
      public string Street { get; set; }
      public string ZipCode { get; set; }
      public string City { get; set; }
      public State State { get; set; }
      public Country Country { get; set; }
  }
  </code></pre>
  <p>I need to configure <code>Address</code> class with Fluent API that <code>Address.Street</code> is for <code>Customer</code> and <code>Employee</code> MaxLength = 50?</p>
  <p>Is it possible to configure it for both at the same time? Or do I need to configure it for each entity?</p>
  <p>Thanks for your help!</p>