Hi, does this (Pomelo.EntityFrameworkCore.MySql) support ulong (mapped to bigint in mysql)?
I created an entity with ulong as PK and I can add it and save it just fine but when I try to get it (using .Find or .FirstOrDefault) I get an exception saying "Unable to cast object of type 'System.Int64' to type 'System.UInt64'.".
at Microsoft.EntityFrameworkCore.Storage.SynchronizedMySqlDataReader.ConvertWithReflection[T](Int32 ordinal, InvalidCastException e)
at Microsoft.EntityFrameworkCore.Storage.SynchronizedMySqlDataReader.GetFieldValue[T](Int32 ordinal)
at lambda_method(Closure , DbDataReader )
at Microsoft.EntityFrameworkCore.Storage.Internal.TypedRelationalValueBufferFactory.Create(DbDataReader dataReader)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(Boolean buffer)
at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_ShapedQuery>d__3`1.MoveNext()
at Microsoft.EntityFrameworkCore.Query.Internal.MySqlQueryingEnumerable`1.MySqlEnumerator.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at lambda_method(Closure , QueryContext )
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass20_0`1.<CompileQueryCore>b__0(QueryContext qc)
at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
at RaidBot.Database.GuildRepository.GetGuild(UInt64 id) in E:\code\git\RaidBot\RaidBot\Database\GuildRepository.cs:line 25
Hello, I'm coming to you about a problem with ASP.NET core 2.0 and EntityFramework Core 2.0.
I can not execute migrations with dotnet cli.
I have configured my .csproj file with the EntityFramework dependencies:
<ItemGroup>
<PackageReference Include = "Microsoft.AspNetCore.All" Version = "2.0.0" />
</ ItemGroup>
<ItemGroup>
<PackageReference Include = "Pomelo.EntityFrameworkCore.MySql" Version = "2.0.0-rtm-10058" />
<PackageReference Include = "Pomelo.EntityFrameworkCore.MySql.Design" Version = "1.1.2" />
</ ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include = "Microsoft.EntityFrameworkCore.Tools.DotNet" Version = "2.0.0" />
<DotNetCliToolReference Include = "Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version = "2.0.0" />
</ ItemGroup>
I configured my DbContext with DI in the statup.cs file :Services.AddDbContext <ApplicationDbContext> (options => options.UseMySql (Configuration.GetConnectionString ("MySQLConnection"));
But when I launch :
"Dotnet ef migrations add InitialCreate"
I have the following errors:
An error occurred while calling method 'BuildWebHost' on class 'Program'. Continuing without the application service provider. Error: Could not find file '/home/aborderon/workdir/Preconeo/ibis/ibis-core-api/src/IBISCoreAPI/bin/Debug/netcoreapp2.0/ef.xml'.
Unable to create an object of type 'ApplicationDbContext'. Add an implementation of 'IDesignTimeDbContextFactory <ApplicationDbContext>' to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.
MySqlException: Unable to connect to any of the specified MySQL hosts. - MySqlConnector.Core.ServerSession+<ConnectAsync>d__56.MoveNext() in ServerSession.cs, line 212
. I was wondering up to wich version of mysql does pomelo works with? Web app is running 5.7.9. But I don't think that's the problem. Any ideas?script-migrate
and ran it.