Caveat: I'm very new to this, so go easy on me.
I'm developing an netcore application and am using Npgsql to connect to a postgresql database. I'm not sure what is causing the error, but when I try to run Add-Migration with a model that has a 2-d array (double[][]) with the [NotMapped] attribute, I get the following error:

> 
> System.InvalidCastException: Unable to cast object of type
>  'Microsoft.EntityFrameworkCore.Storage.Internal.NpgsqlArrayTypeMapping'
>  to type
>  'Microsoft.EntityFrameworkCore.Storage.Internal.NpgsqlBaseTypeMapping'.
> 
> 
> 

I suspect it's not a Npgsql issue since, I would think, the [NotMapped] attribute should ignore the double[][] and not try to map it to something.

This is the offending part of the model

```
[NotMapped]
public double[][] LossData
{
    get
    {
       return JsonConvert.DeserializeObject<double[][]>(InternalLossData);
    }
    set
    {
       InternalLossData = JsonConvert.SerializeObject(value);
}

```

Microsoft.EntityFrameworkCore.Tools is version 1.1.0-preview4-final. I assume this is the package responsible for Add-Migration and therefore I suspect the problem may be there.

But I don't know. 

**Update**

mww's suggestion didn't work so I switched over to using the default sql driver (not Npgsql) and it worked. So that narrows it down to something I'm not doing correctly or something with Npgsql.