There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
francis
Posts: 12
Joined: Tue 23 Dec 2014 21:13

There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Thu 10 Sep 2020 22:07

Hi,

I have a large native query that returns many bigint(x) columns on a MySQL 5.7 db.

I run it with context.Database.SqlQuery<MyCustomClass>(query).ToList();

Accoring to this link https://www.devart.com/dotconnect/mysql ... pping.html, the only type that gets concerted to SByte is tinyint, but when I run the query in dbForge Studio, I do not get any rows as tinyint. I get int, uint, bigint(1 to 11).

Why am I getting this werror and how can I debug this? The only error I get is this, but I have a large query with ~70 columns so how can I figure out which column is the offender?

System.NotSupportedException: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'.
at System.Data.Entity.SqlServer.SqlProviderManifest.GetStoreType(TypeUsage edmType)
at System.Data.Entity.ModelConfiguration.Edm.Services.StructuralTypeMappingGenerator.MapTableColumn(EdmProperty property, String columnName, Boolean isInstancePropertyOnDerivedType)
at System.Data.Entity.ModelConfiguration.Edm.Services.PropertyMappingGenerator.Generate(EntityType entityType, IEnumerable`1 properties, EntitySetMapping entitySetMapping, MappingFragment entityTypeMappingFragment, IList`1 propertyPath, Boolean createNewColumn)
at System.Data.Entity.ModelConfiguration.Edm.Services.TableMappingGenerator.Generate(EntityType entityType, DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.GenerateEntityTypes(DbDatabaseMapping databaseMapping)
at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.Generate(EdmModel conceptualModel)
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.RetryLazy`2.GetValue(TInput input)
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.InternalContext.Initialize()
at System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext()
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery[TElement](String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQueryAsIEnumerator[TElement](String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery(Type elementType, String sql, Nullable`1 streaming, Object[] parameters)
at System.Data.Entity.Internal.InternalSqlNonSetQuery.GetEnumerator()
at System.Data.Entity.Infrastructure.DbRawSqlQuery`1.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)

francis
Posts: 12
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Thu 10 Sep 2020 22:31

This results in the same error, so it's not the query:
context.Database.SqlQuery<MyCustomClass>("SELECT firstname FROM people LIMIT 1").ToList()

class MyCustomClass
{
public string FirstName { get; set; }
}

Could it be it the model itself? One of the 30 tables has many tinyint fields which got mapped to sbyte by EntityDeveloper. But it can't be that: many classes have SByte properties, and I've been using that model for years with Devart.

I have no clue where to go from here.

Shalex
Site Admin
Posts: 9020
Joined: Thu 14 Aug 2008 12:44

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by Shalex » Fri 11 Sep 2020 17:54

Try opening your *.edml model with XML Editor and look for SByte entries.

francis
Posts: 12
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Fri 11 Sep 2020 18:50

There are 132 of them, in many classes (there are 92 EntityTypes) I've been using without errors for years. I recently added a few more classes (with yet more SBytes) for this project and now the model dies. What should I do?

I cannot modify the tables for legacy reasons.

Shalex
Site Admin
Posts: 9020
Joined: Thu 14 Aug 2008 12:44

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by Shalex » Tue 15 Sep 2020 14:13

francis wrote:
Thu 10 Sep 2020 22:07
System.NotSupportedException: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'.
at System.Data.Entity.SqlServer.SqlProviderManifest.GetStoreType(TypeUsage edmType)
[...]
That is a stack trace of a different provider that talks to SQL Server instead of MySQL.

Please send us a small test project with the corresponding DDL/DML script so that we can reproduce the error in our environment.


francis
Posts: 12
Joined: Tue 23 Dec 2014 21:13

Re: There is no store type corresponding to the conceptual side type 'SByte' of primitive type 'SByte'

Post by francis » Fri 18 Sep 2020 16:10

Is anyone working on this? Did you receive my repro solution?

Post Reply