Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EF Core 2.1 Preview 1 throws MissingMethodException when using Pomelo.EntityFrameworkCore.MySql #11078

Closed
AdamDotNet opened this issue Feb 27, 2018 · 43 comments

Comments

@AdamDotNet
Copy link

After reading that EF Core 2.1 Preview 1 became available on Nuget, I wanted to if GroupBy SQL translation would just work using a 2.0 provider. My test didn't get far, however, and something as simple as ToListAsync throws an exception. Provider details are at the bottom.

The article stated:

Note that although there are a few features, such as value conversions, that require an updated database provider, existing providers developed for EF Core 2.0 should be compatible with EF Core 2.1. If there is any incompatibility, that is a bug we want to hear about!

That's why I am here.

Exception message:
System.MissingMethodException: 'Method not found: 'Void Microsoft.EntityFrameworkCore.Storage.Internal.RelationalParameterBuilder..ctor(Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper)'.'
Stack trace:
   at Microsoft.EntityFrameworkCore.Storage.Internal.MySqlCommandBuilder..ctor(IDiagnosticsLogger`1 logger, IRelationalTypeMapper typeMapper)
   at Microsoft.EntityFrameworkCore.Storage.Internal.MySqlCommandBuilderFactory.CreateCore(IDiagnosticsLogger`1 logger, IRelationalTypeMapper relationalTypeMapper)
   at Microsoft.EntityFrameworkCore.Storage.Internal.MySqlCommandBuilderFactory.Create()
   at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.GenerateSql(IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Query.Internal.RelationalExpressionPrinter.CommandBuilderPrinter.TryPrintConstant(ConstantExpression constantExpression, IndentedStringBuilder stringBuilder, Boolean removeFormatting)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.VisitConstant(ConstantExpression constantExpression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Visit(Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Visit(Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Visit(Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Visit(Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.VisitLambda[T](Expression`1 lambdaExpression)
   at System.Linq.Expressions.Expression`1.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.ExpressionVisitor.Visit(Expression node)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Visit(Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.PrintInternal(Expression expression, Boolean removeFormatting, Nullable`1 characterLimit, Boolean highlightNonreducibleNodes)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Print(Expression expression, Boolean removeFormatting, Nullable`1 characterLimit)
   at Microsoft.EntityFrameworkCore.Internal.CoreLoggerExtensions.QueryExecutionPlanned(IDiagnosticsLogger`1 diagnostics, IExpressionPrinter expressionPrinter, Expression queryExecutorExpression)
   at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.CreateExecutorLambda[TResults]()
   at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.CreateAsyncQueryExecutor[TResult](QueryModel queryModel)
   at Microsoft.EntityFrameworkCore.Storage.Database.CompileAsyncQuery[TResult](QueryModel queryModel)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileAsyncQueryCore[TResult](Expression query, IQueryModelGenerator queryModelGenerator, IDatabase database)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass22_0`1.<CompileAsyncQuery>b__0()
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func`1 compiler)
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddAsyncQuery[TResult](Object cacheKey, Func`1 compiler)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileAsyncQuery[TResult](Expression query)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.ExecuteAsync[TResult](Expression query)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.ExecuteAsync[TResult](Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.System.Collections.Generic.IAsyncEnumerable<TResult>.GetEnumerator()
   at System.Linq.AsyncEnumerable.<Aggregate_>d__6`3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at ConsoleApp1.Program.<Main>d__0.MoveNext() in C:\Users\Adam\Desktop\MySqlCoreTesting\ConsoleApp1\Program.cs:line 42
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at ConsoleApp1.Program.<Main>(String[] args)

Steps to reproduce

public class ProjectDbContext : DbContext
{
    public ProjectDbContext(DbContextOptions<ProjectDbContext> options)
        : base(options) { }

    public DbSet<Item> Items { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);

        modelBuilder.Entity<Item>()
            .HasKey(i => i.Id);
        modelBuilder.Entity<Item>()
            .Property(p => p.Label)
            .HasColumnType("text");
    }
}

public class Item
{
    public int Id { get; set; }

    public string Label { get; set; }
}

// .Net Core 2.0 Console application
class Program
{
    static async Task Main(string[] args)
    {
        DbContextOptionsBuilder<ProjectDbContext> builder = new DbContextOptionsBuilder<ProjectDbContext>();
        builder.UseMySql("Your connection string.");
        using (ProjectDbContext _dbContext = new ProjectDbContext(builder.Options))
        {
            await _dbContext.Items.ToListAsync();
        }
    }
}

Further technical details

EF Core version: "Microsoft.EntityFrameworkCore.Relational" Version="2.1.0-preview1-final"
Database Provider:
"Pomelo.EntityFrameworkCore.MySql" Version="2.0.1"
"MySqlConnector" Version="0.36.0"
Operating system: Windows 10 16299.248 x64
IDE: Visual Studio 2017 15.5.7

@AdamDotNet AdamDotNet changed the title EF Core 2.1 Preview 1 throws MissingMethodException EF Core 2.1 Preview 1 throws MissingMethodException when using Pomelo.EntityFrameworkCore.MySql Feb 27, 2018
@ajcvickers
Copy link
Member

@AdamDotNet Thanks for reporting this. It is happening because the MySQL provider is making use of EF Core internal code--I filed this issue for that: PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#497

From the EF side, we will discuss in triage whether or not to revert this change to the internal code, but the long term solution is for the provider to stop using internal code.

@AdamDotNet
Copy link
Author

@ajcvickers Thanks for pointing this out and writing up the issue with the PomeloFoundation!

@jemiller0
Copy link

Thanks for reporting this. I ran into this too and was getting ready to file an issue. I wasn't sure if providers would need to be updated to work with the new 2.1 update. Theoretically, minor revision number changes don't have breaking changes, but, I figured an update would probably be needed. The Npgsql provider seemed to have a different issue, but, luckily there is a preview release of that provider that fixed that issue.

@jemiller0
Copy link

I wonder if Oracle's MySQL provider works? I switched to Pomelo awhile back because Oracle was taking a long time getting their provider to work. Maybe it is better now.

@roji
Copy link
Member

roji commented Feb 28, 2018

@jemiller0 great to hear Npgsql is working ok for you on 2.1.0-preview1! Although it might be interesting what problem the 2.0 version of the provider had with the 2.1 version of the core.

@jemiller0
Copy link

@roji Thanks for the great work that you've been doing with the Npgsql providers. I know that I can always count on you to be right on top of things. You always seem to be in lockstep with the EF team at Microsoft. I was using the 2.0.1 provider and ran into the following exception. For some reason the Y in "p2"."actv_ind" = Y, wasn't quoted. When I upgraded to the 2.1.0 preview that you have, it worked fine. I just figured it was a known issue that you fixed.

OleLibrary Verbose: 0 : Executing DbCommand [Parameters=[@__id_0='?'], CommandType='Text', CommandTimeout='30']
SELECT "p2"."entity_id", "p2"."actv_ind", "p2"."obj_id", "p2"."last_updt_dt", "p2"."ver_nbr", "p2.PersonPrivacy"."entity_id", "p2.PersonPrivacy"."obj_id", "p2.PersonPrivacy"."last_updt_dt", "p2.PersonPri
vacy"."suppress_addr_ind", "p2.PersonPrivacy"."suppress_email_ind", "p2.PersonPrivacy"."suppress_nm_ind", "p2.PersonPrivacy"."suppress_prsnl_ind", "p2.PersonPrivacy"."suppress_phone_ind", "p2.PersonPriva
cy"."ver_nbr", "p2.PersonExt"."id", "p2.PersonExt"."chicago_id", "p2.PersonExt"."creation_time", "p2.PersonExt"."creation_user_name", "p2.PersonExt"."last_write_time", "p2.PersonExt"."last_write_user_nam
e", "p2.PersonExt"."staff_department", "p2.PersonExt"."staff_division", "p2.PersonExt"."staff_privileges", "p2.PersonExt"."staff_status", "p2.PersonExt"."status", "p2.PersonExt"."statuses", "p2.PersonExt
"."student_department", "p2.PersonExt"."student_division", "p2.PersonExt"."student_id", "p2.PersonExt"."student_restriction", "p2.PersonExt"."student_status", "p2.Patron"."ole_ptrn_id", "p2.Patron"."acti
vation_date", "p2.Patron"."actv_ind", "p2.Patron"."courtesy_notice", "p2.Patron"."delivery_privilege", "p2.Patron"."expiration_date", "p2.Patron"."general_block", "p2.Patron"."general_block_nt", "p2.Patr
on"."obj_id", "p2.Patron"."inv_barcode_num", "p2.Patron"."inv_barcode_num_eff_date", "p2.Patron"."barcode", "p2.Patron"."paging_privilege", "p2.Patron"."ole_stat_cat", "p2.Patron"."borr_typ", "p2.Patron"
."photograph", "p2.Patron"."ole_src", "p2.Patron"."ver_nbr"
FROM "krim_entity_t" AS "p2"
LEFT JOIN "krim_entity_priv_pref_t" AS "p2.PersonPrivacy" ON "p2"."entity_id" = "p2.PersonPrivacy"."entity_id"
LEFT JOIN "uc_entity_ext" AS "p2.PersonExt" ON "p2"."entity_id" = "p2.PersonExt"."id"
LEFT JOIN "ole_ptrn_t" AS "p2.Patron" ON "p2"."entity_id" = "p2.Patron"."ole_ptrn_id"
WHERE ("p2"."entity_id" = @__id_0) AND ("p2"."actv_ind" = Y)
LIMIT 2
    ThreadId=11
    DateTime=2018-02-28T01:08:11.5256865Z
OleWebApplication Critical: 0 : System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Npgsql.PostgresException (0x80004005): 42703: column
 "y" does not exist
   at Npgsql.NpgsqlConnector.<DoReadMessage>d__157.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
   at Npgsql.NpgsqlConnector.<ReadMessage>d__156.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Npgsql.NpgsqlConnector.<ReadMessage>d__156.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
   at Npgsql.NpgsqlConnector.<ReadExpecting>d__163`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
   at Npgsql.NpgsqlDataReader.<NextResult>d__32.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Npgsql.NpgsqlDataReader.NextResult()
   at Npgsql.NpgsqlCommand.<Execute>d__71.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
   at Npgsql.NpgsqlCommand.<ExecuteDbDataReader>d__92.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ValueTaskAwaiter`1.GetResult()
   at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.BufferlessMoveNext(DbContext _, Boolean buffer)
   at Microsoft.EntityFrameworkCore.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ResultEnumerable`1.GetEnumerator()
   at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.<_TrackEntities>d__17`2.MoveNext()
   at Microsoft.EntityFrameworkCore.Query.Internal.LinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext()
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass15_1`1.<CompileQueryCore>b__0(QueryContext qc)
   at OleWebApplication.People.Edit.PersonFormView_DataBinding(Object sender, EventArgs e) in C:\Users\jemiller\Documents\Visual Studio 2017\Projects\Ole5\OleWebApplication\People\Edit.aspx.cs:line 31

The query being run is.

var p = oleContext.People.Include(p2 => p2.Patron).Include(p2 => p2.PersonExt).Include(p2 => p2.PersonPrivacy).SingleOrDefault(p2 => p2.Id == id && p2.Active == "Y");

@AdamDotNet
Copy link
Author

AdamDotNet commented Feb 28, 2018

@jemiller0

I wonder if Oracle's MySQL provider works? I switched to Pomelo awhile back because Oracle was taking a long time getting their provider to work. Maybe it is better now.

Oracle's 2.0 provider does this, using the same code in the OP:

System.MissingMethodException: 'Method not found: 'Void Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommandBuilderFactory..ctor(Microsoft.EntityFrameworkCore.Diagnostics.IDiagnosticsLogger`1<Command>, Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper)'.'

A more complex model will throw this:

System.NotImplementedException: 'The 'MySQLNumberTypeMapping' does not support value conversions. Support for value conversions typically requires changes in the database provider.'

Stack traces omitted for brevity

That thoroughly sounds like Oracle's problem, not EF, so I don't know if the EF team wants a new issue opened for Oracle's provider or not, given their statement regarding 2.0 providers should work on 2.1 EF. @ajcvickers will you provide guidance?

@roji
Copy link
Member

roji commented Feb 28, 2018

@jemiller0 ok thanks - yeah, that's a known issue.

(and thanks for the kind words!)

@ajcvickers
Copy link
Member

@AdamDotNet Yes, please file an issue with Oracle. Providers really need to avoid using internal code because they need to keep working after EF Core updates.

@AdamDotNet
Copy link
Author

Oracle bug report: https://bugs.mysql.com/bug.php?id=89855

@jemiller0
Copy link

@ajcvickers I haven't looked at the code, but, could you make it so that the internal packages are use the C# internal or private keywords to prevent people from using them? I'm assuming there is probably a reason you haven't already done this. If not, maybe you can make them inaccessible to prevent providers from doing this in the future.

@ajcvickers
Copy link
Member

@jemiller0 I wrote a blog post on it a while ago: https://blog.oneunicorn.com/2016/11/09/internal-code-in-ef-core-1-1/

In general I think that having internal code available to use is working well for application-level development. The problem is provider writers need to be more diligent and understand the consequences. I'm hoping that we can work through this and we are not forced to take away access to internal code, but certainly if it causes enough problems, then that's what we will have to do.

@ErikEJ
Copy link
Contributor

ErikEJ commented Feb 28, 2018

@ajcvickers Please dont!! - but provide clear provider guidance/advise

@ajcvickers
Copy link
Member

@ErikEJ We do need to be better about communicating changes to provider writers. I chatted with Shay about this when he was here--it would be good to hear your thoughts. Are you at the summit next week?

@ErikEJ
Copy link
Contributor

ErikEJ commented Feb 28, 2018

Yes, I am 😎

@gsaldana
Copy link

Hi everyone
I'm using EntityFrameworkCore 2.1.0-preview2-final with Pomelo.EntityFrameworkCore.MySql 2.0.1
and I'm getting the same issue with 'Void Microsoft.EntityFrameworkCore.Storage.Internal.RelationalParameterBuilder..ctor(Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper)'.
Is there any way to solve it?

Thanks in advance.

@ajcvickers
Copy link
Member

@gsaldana The Pomelo MySQL provider is currently not working with EF Core 2.1. We are looking into potential ways that we can help with this, but we don't have concrete plans yet.

@sam-wheat
Copy link

Is there an open ticket we can track to stay current on this?

Thanks

@AdamDotNet
Copy link
Author

@sam-wheat - PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#497

@sam-wheat
Copy link

Well this is concerning.

@rizamarhaban
Copy link

rizamarhaban commented May 31, 2018

Oh no... I also got this after upgrading to EFCore 2.1.
System.NotImplementedException: 'The 'MySQLNumberTypeMapping' does not support value conversions. Support for value conversions typically requires changes in the database provider.

Monitoring this: https://bugs.mysql.com/bug.php?id=89855

@sam-wheat
Copy link

@ajcvickers
Copy link
Member

@sam-wheat @AdamDotNet @rizamarhaban We have been working with the MySQL provider guys to update the provider to work with 2.1. There are a few issues that they still want to resolve before releasing. Work is being tracked by them here: PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#514

@sam-wheat
Copy link

@ajcvickers Thank you for the update. I am not clear about the relationship between Pomelo and Oracle. So when you say "the MySQL provider guys" do you also mean Oracle? I am referring to the MySQL client provided here. If they are a separate entity from Pomelo do you know if they will eventually be supporting EF 2.1?

@ajcvickers
Copy link
Member

@sam-wheat I haven't seen any activity in a long time related to the MySQL provider from Oracle. Your best bet is to contact them and ask.

@OmarElMallahy
Copy link

OmarElMallahy commented Jun 4, 2018

I have the same issue after updating to .NET Core 2.1 and EF Core 2.1, I use MySql.Data.EntityFrameworkCore.
Is it the same issue of Pomelo.EntityFrameworkCore.MySql or not?

@AdamDotNet
Copy link
Author

@OmarElMallahy Pomelo is completely separate from Oracle, and currently neither have production releases that work for EF Core 2.1. However, Pomelo recently released a 2.1 compatible release candidate.
Repo comment and NuGet.

MySQL.Data.EntityFrameworkCore is Oracle's first party provider and there is no known time frame for it to be completed, though I opened the ticket with them that's already been linked to in this thread.

@pmmcmullen94
Copy link

What is the temporary/permanent fix for this? I'm trying to create a webapi on .net core and entity framework is not able to create the database. Is the fix to not use migrations for now?

@AdamDotNet
Copy link
Author

@pmmcmullen94
Temporary fix 1: Use EF Core 2.0 bits.
Temporary fix 2: Use a pre-release build of Pomelo's 2.1 provider, linked to in this thread.

Permanent fix: wait until Pomelo's or Oracle's 2.1 provider releases production quality builds. (You might be waiting a while for Oracle's, in my opinion.)

@Hokutosei
Copy link

hit with same problem today.. I guess we'll stick to 2.0 for the meantime..

@DanteDiaz
Copy link

DanteDiaz commented Jun 7, 2018

@AdamDotNet why temporary? the option 2 it work for me

@AdamDotNet
Copy link
Author

@DanteDiaz only temporary in that when the production release is available, one should stop using the pre-release build. I'm glad the pre-release build is working for you in the meantime!

@alexsandro-xpt
Copy link

Same problem here after update project to asp.net 2.1.

So I change MySql.Data.EntityFrameworkCore to Pomelo.EntityFrameworkCore.MySql@2.1.0-rc1-final but I lose:

  1. ForMySQLHasCharset function for my entity config builder.Property(c => c.InstanceName).ForMySQLHasCharset("latin1").ForMySQLHasCollation("latin1_general_ci");
  2. And new DbContextOptionsBuilder().UseMySQL(config).Options to lower case UseMySql at new DbContextOptionsBuilder().UseMySql(config).Options

@uegomgom
Copy link

I have same problem.
When will this problem fix?

@ajcvickers
Copy link
Member

@uegomgom
Copy link

Thank you for your information.
And I'm sorry. My bad. It works.

I mistook the context initialize.
optionsAction.UseMySQL(Configuration.GetConnectionString("MysqlCon"));
-> This doesn't work on EF2.1
optionsAction.UseMySql(Configuration.GetConnectionString("MysqlCon"));
-> This works on EF2.1

Thanks.

@rchrismon
Copy link

Uegomgom, just so I understand, your second line of code is using Pomelo, right? I ask because using the MySQL provider is ...UseMySQL. Pomelo's is ...UseMysql (note caps change).

So, the release candidate for the Pomelo provider works with EF 2.1?

@jemiller0
Copy link

jemiller0 commented Jul 9, 2018

The release version 2.1.1 of Pomelo is out now. I found it on NuGet this morning.

@pmmcmullen94
Copy link

@rchrismon yes, that is correct. There is a slight difference in some of the naming between Pomelo and the official MySQL libraries. Nothing too far off though

@uegomgom
Copy link

uegomgom commented Aug 6, 2018

@rchrismon, Yes. your understand is right. I'm using Pomelo. And Pomelo is working on my EF2.1.
A addtional information is this program works on my raspberry pi. So I think it's collect to work EF2.1 on dotnet core 2.1.
(it is too late comment, isn't it?...)

@himalayagarg
Copy link

This issue still exists in Pomelo.EntityFrameworkCore.MySql 2.1.2 with Microsoft.EntityFrameworkCore (2.1.2)

@liquanyulll
Copy link

The 'MySqlDecimalTypeMapping' does not support value conversions. Support for value conversions typically requires changes in the database provider.

@john-mbone
Copy link

Replace Nuget Package MySql.Data.EntityFrameworkCore with MySql.EntityFrameworkCore

Scaffold-DbContext "server=127.0.0.1;database=chama;user=root;treattinyasboolean=true;" MySql.EntityFrameworkCore -ContextDir Models/Contexts/ -OutputDir Models/Repositories/ -UseDataBaseNames -Verbose

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests