No mapping to a relational type can be found for the CLR type 'Microsoft.EntityFrameworkCore.Metadata.Internal.Property' - 7.06.IR31
Posted by: Richard Cannock
Date: January 04, 2017 06:27AM

HI,

I have the following class with a guid Id. I've stripped out all other properties to excluded them as potential causes of error.

//[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid Id { get; set; }

I have also tried using the [Key] attribute, or configuring instead in onModelBuilding


Unfortunately, i get the following stack trace:

System.InvalidOperationException: No mapping to a relational type can be found for the CLR type 'Microsoft.EntityFrameworkCore.Metadata.Internal.Property'
at Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapperExtensions.GetMapping(IRelationalTypeMapper typeMapper, IProperty property)
at MySQL.Data.EntityFrameworkCore.Migrations.MySQLMigrationsSqlGenerator.ColumnDefinition(String schema, String table, String name, Type clrType, String type, Nullable`1 unicode, Nullable`1 maxLength, Boolean rowVersion, Boolean nullable, Object defaultValue, String defaultValueSql, String computedColumnSql, IAnnotatable annotatable, IModel model, MigrationCommandListBuilder builder)
at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.ColumnDefinition(AddColumnOperation operation, IModel model, MigrationCommandListBuilder builder)
at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(CreateTableOperation operation, IModel model, MigrationCommandListBuilder builder)
at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model)
at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.CreateTables()
at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.EnsureCreated()
at RaceOrganisation.Data.MySql.RaceOrganisationContext..ctor(DbContextOptions`1 options) in C:\Development\RaceOrganisation.Web - Copy\RaceOrganisation.Data.MySql\RaceOrganisationContext.cs:line 16}

When trying to call Database.EnsureCreated.

Any ideas? Thanks.

Options: ReplyQuote


Subject
Written By
Posted
No mapping to a relational type can be found for the CLR type 'Microsoft.EntityFrameworkCore.Metadata.Internal.Property' - 7.06.IR31
January 04, 2017 06:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.