-
Notifications
You must be signed in to change notification settings - Fork 257
Closed
Milestone
Description
I've attempted to use the new custom range type support with LocalTime (from NodaTime).
So I've set it up with:
services.AddDbContext<MainContext>(options =>
options.UseNpgsql(
Configuration.GetConnectionString("MainContext"),
opts =>
{
opts.UseNodaTime();
opts.MapRange<LocalTime>("timerange");
}));
and:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.ForNpgsqlHasRange("timerange", "time");
// ...
}
Then in one of my model classes I've put:
public NpgsqlRange<LocalTime> Period { get; set; }
Then I ran:
dotnet ef migrations add Initial
and I get:
System.TypeLoadException: Could not load type 'Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.Mapping.NpgsqlRangeTypeMapping`1' from assembly 'Npgsql.EntityFrameworkCore.PostgreSQL, Version=2.2.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'.
at Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime.NodaTimePlugin..ctor()
at Microsoft.EntityFrameworkCore.NodaTimeDbContextOptionsExtensions.UseNodaTime(NpgsqlDbContextOptionsBuilder optionsBuilder) in /home/roji/projects/EFCore.PG/src/EFCore.PG.NodaTime/NodaTimeDbContextOptionsExtensions.cs:line 20
at Server.Startup.<>c.<ConfigureServices>b__4_2(NpgsqlDbContextOptionsBuilder opts)
These are the versions I'm using:
<PackageReference Include="NodaTime" Version="2.3.0" />
<PackageReference Include="Npgsql" Version="4.0.3" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="2.2.0-preview1" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL.NodaTime" Version="2.1.1" />
What am I doing wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels