[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");
什么都没有,这是例外:
system.invalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.Single[TSource](IEnumerable1 source,Func
2 predicate)
at System.Data.Entity.Utilities.DbProviderManifestExtensions.GetStoreTypeFromName(DbProviderManifest providerManifest,String name)
at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.ConfigureColumn(EdmProperty column,EntityType table,DbProviderManifest providerManifest)
at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure(EdmProperty column,DbProviderManifest providerManifest,Boolean allowOverride,Boolean fillFromExistingConfiguration)
at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.<>c__displayClass4.b__3(Tuple2 pm)
1 ts,Action
at System.Data.Entity.Utilities.IEnumerableExtensions.Each[T](IEnumerable1 action)
1 propertyMappings,Boolean fillFromExistingConfiguration)
at System.Data.Entity.ModelConfiguration.Configuration.Properties.Primitive.PrimitivePropertyConfiguration.Configure(IEnumerable
at System.Data.Entity.ModelConfiguration.Configuration.Types.StructuralTypeConfiguration.ConfigurePropertyMappings(IList1 propertyMappings,Boolean allowOverride)
1 entitySets,DbProviderManifest providerManifest)
at System.Data.Entity.ModelConfiguration.Configuration.Types.EntityTypeConfiguration.ConfigurePropertyMappings(DbDatabaseMapping databaseMapping,EntityType entityType,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
at System.Data.Entity.ModelConfiguration.Configuration.ModelConfiguration.Configure(DbDatabaseMapping databaseMapping,DbProviderManifest providerManifest)
at System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest,DbProviderInfo providerInfo)
at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
at System.Data.Entity.Internal.RetryLazy2.GetValue(TInput input)
1.Initialize()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
at System.Data.Entity.Internal.Linq.InternalSet
at System.Data.Entity.Internal.Linq.InternalSet1.get_InternalContext()
1.get_Local()
at System.Data.Entity.Internal.Linq.InternalSet
at System.Data.Entity.DbSet`1.get_Local()
at 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:line 26
这是我的配置:
<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" />
解决方法
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。