Ich versuche, eine Migration mit einer JSON-Spalte zu erstellen. Hier ist, was ich versucht:Npgsql/EF 6 - JSON-Spalte
[Column(TypeName = "Jsonb")]
public string Data { get; set; }
[Column(TypeName = "Json")]
public string Data { get; set; }
modelBuilder.Entity<Member>().Property(p => p.Data).HasColumnType("Json");
modelBuilder.Entity<Member>().Property(p => p.Data).HasColumnType("Jsonb");
Gar nichts funktioniert, ist hier die Ausnahme:
System.InvalidOperationException: Sequenz enthält kein Anpassungselement bei System.Linq.Enumerable.Single [TSource] (IEnumerable
1 source, Func
2 Prädikats) bei System.Data.Entity.Utilities.DbProviderManifestExtensions.GetStoreTypeFromName (DbProviderManifest providerManifest, String name) bei System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.ConfigureColumn (EdmProperty Spalte, Ent ityType Tisch, DbProviderManifest providerManifest) bei System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure (EdmProperty Spalte EntityType Tabelle DbProviderManifest providerManifest, Boolean allowOverride, Boolean fillFromExistingConfiguration) bei System.Data.Entity.ModelConfiguration .Configuration.Properties.Primitive.PrimitivePropertyConfiguration. <> c__DisplayClass4.b__3 (Tuple2 pm) at System.Data.Entity.Utilities.IEnumerableExtensions.Each[T](IEnumerable
1 ts, Aktion1 action) at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure(IEnumerable
1 propertyMappings, DbProviderManifest providerManifest, Boolean allowOverride, Boolean fillFromExistingConfiguration) bei System.Data.Entity.ModelConfiguration.Configuration.Types.StructuralTypeConfiguration.ConfigurePropertyMappings (IList1 propertyMappings, DbProviderManifest providerManifest, Boolean allowOverride) at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.ConfigurePropertyMappings(DbDatabaseMapping databaseMapping, EntityType entityType, DbProviderManifest providerManifest, Boolean allowOverride) at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.Configure(EntityType entityType, DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest) at System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.ConfigureEntityTypes(DbDatabaseMapping databaseMapping, ICollection
1 entitySets, DbProviderManifest providerManifest) bei System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.Configure (DbDatabaseMapping databaseMapping, DbProviderManifest providerManifest) bei System.Data.Entity.DbModelBuilder.Build (DbProviderManifest providerManifest, DbProviderInfo Provider) bei System.Data.Entity.DbModelBuilder .Build (DbConnection providerConnection) bei System.Data.Entity.Internal.LazyInternalC ontext.CreateModel (LazyInternalContext internalContext) bei System.Data.Entity.Internal.RetryLazy2.GetValue(TInput input) at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) at System.Data.Entity.Internal.Linq.InternalSet
1.Initialize() bei System.Data.Entity.Internal.Linq.InternalSet1.get_InternalContext() at System.Data.Entity.Internal.Linq.InternalSet
1.get_Local() bei System.Data.Entity .DbSet`1.get_Local() bei System.Data.Entity.DbModelBuilderExtensions.RegisterUserAccountChildTablesForDelete [TKey, TAccount, TUserClaim, TLinkedAccount, TLinkedAccountClaim, TPasswordResetSecret, TTwoFactorAuthToken, TUserCertificate] (DbContext CTX) in C: \ ballen \ github \ brockallen \ BrockAllen.MembershipReboot \ src \ BrockAllen.MembershipReboot.Ef \ DbModelBuilderExtensions.cs: Linie 26
Hier ist meine config:
<package id="EntityFramework" version="6.1.1" targetFramework="net452" />
<package id="EntityFramework6.Npgsql" version="3.1.1" targetFramework="net452" />
<package id="Npgsql" version="3.1.6" targetFramework="net452" />