Skip to content

Provider-specific date/time types (e.g. NpgsqlDate) not supported in 2.1.0 #467

Description

@iflight

After update to net core 2.1 and Npgsql.EntityFrameworkCore.PostgreSQL 2.1, EF throw exception:

System.InvalidOperationException: "The property 'TBReestr.TBrDateEnd' is of type 'Nullable<NpgsqlDate>' which is not supported by current database provider.

And same problem with Nullable<NpgsqlDateTime>.

part of Model:

publicclassTBReestr{publiclongTBrId{get;set;}publicNpgsqlDate?TBrDateStart{get;set;}publicNpgsqlDate?TBrDateEnd{get;set;}}

modelBuilder:

modelBuilder.Entity<TBReestr>(entity =>{entity.HasKey(e =>e.TBrId);entity.ToTable("tBReestr");entity.Property(e =>e.TBrDateStart).HasColumnName("tBR_DateStart");entity.Property(e =>e.TBrDateEnd).HasColumnName("tBR_DateEnd");}

Connection:

services.AddEntityFrameworkNpgsql().AddDbContextPool<DataContext>(options =>options.UseNpgsql(configuration.GetConnectionString("DataConnection")));

Npgsql version: 4.0
Npgsql.EntityFrameworkCore.PostgreSQL 2.1
net core 2.1
PostgreSQL version: 9.6.6
Operating system: Win10

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions