title: EF Core 2.2 spatial type can't be added to db migration
body: <p>I'm trying to build a database with a spatial object using EF core 2.2, and i'm getting a problem with trying to create the database migrations.  using <a href="https://docs.microsoft.com/en-us/ef/core/modeling/spatial" rel="noreferrer">https://docs.microsoft.com/en-us/ef/core/modeling/spatial</a> , specifically:</p>
  
  <pre><code>class Country
  {
      public int CountryID { get; set; }
  
      public string CountryName { get; set; }
  
      // Database includes both Polygon and MultiPolygon values
      public IGeometry Border { get; set; }
  }
  </code></pre>
  
  <p>if i try to create a migration with this i get the following error:</p>
  
  <blockquote>
    <p>The property 'Country.Border' is of an interface type ('IGeometry').
    If it is a navigation property manually configure the relationship for
    this property by casting it to a mapped entity type, otherwise ignore
    the property using the NotMappedAttribute or
    'EntityTypeBuilder.Ignore' in 'OnModelCreating'.</p>
  </blockquote>
  
  <p>similarly if i change it to a Geometry type instead, i get:</p>
  
  <blockquote>
    <p>The property 'Geometry.UserData' could not be mapped, because it is of
    type 'object' which is not a supported primitive type or a valid
    entity type. Either explicitly map this property, or ignore it using
    the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in
    'OnModelCreating'.</p>
  </blockquote>
  
  <p>I don't know ahead of time if my object is going to be a Point or a Line or Polygon, so it has to be generic.  how do i represent that in my structure?  Additionally i've seen some places say i need to add the following code:</p>
  
  <pre><code>public class MyDBContextFactory : IDesignTimeDbContextFactory&lt;MyDBContext&gt;
      {
  
          public MyDBContext CreateDbContext(string[] args)
          {
              var builder = new DbContextOptionsBuilder&lt;MyDBContext&gt;();
              builder.UseSqlServer(cnnString, x =&gt; x.UseNetTopologySuite());
              return new MyDBContext(builder.Options);
          }
     }
  </code></pre>
  
  <p>but i get the error:</p>
  
  <blockquote>
    <p>'SqlServerDbContextOptionsBuilder' does not contain a definition for
    'UseNetTopologySuite' and no accessible extension method
    'UseNetTopologySuite' accepting a first argument of type
    'SqlServerDbContextOptionsBuilder' could be found (are you missing a
    using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>even though i have the nuget package installed</p>