Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Yuko Zheng
    @yukozh
    which version r u using
    ShadowDancer
    @ShadowDancer
    EntityFrameworkCore v1.1.1, Pomelo.EntityFrameworkCore.MySql 1.1.0
    Yuko Zheng
    @yukozh
    please do not mix different versions
    if your ef core is 1.1.1 plz use pomelo 1.1.1-prerelease-*
    ShadowDancer
    @ShadowDancer
    @Kagamine Thanks!
    juandrn
    @juandrn
    pomelo acept ef-code first?
    Yuko Zheng
    @yukozh
    yep
    juandrn
    @juandrn
    :smile:
    Qiao
    @IsQiao
    morning
    Caleb Lloyd
    @caleblloyd
    Congrats to everyone on the 1.1.1 release! This release contains 44 issues fixed, performance increases, and upgrade to 1.0 RTM Tooling
    Yuko Zheng
    @yukozh
    👍🏻👍🏻👍🏻
    Phong Bui
    @loveunCG
    你好
    Light
    @lightgh
    Hi eveyone! It's nice joining the room. I spend long hours fruitlessly trying to get mysql connector (the nuget package provided by oracle) to work with .netcore on ubuntu. I stumbled on this link to this gitter channel. Hope this Provider works!
    Because I can't wait to try it out. As I am using the latest version of .netcore :)
    Chaos
    @ChaosEngine
    Hi, is PomeloFoundation going to stringly sign it's packages? I am doing some work inside Pomelo.Extensions.Caching.MySql project space.
    It would be nice to have strongly signed assemblies of oyher Pomelo...dll
    Adrien Borderon
    @aborderon

    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.

    sorry for my bad english ...
    Chaos
    @ChaosEngine
    Adrien Borderon
    @aborderon
    Thank, @ChaosEngine, I solved my problem
    Phong Bui
    @loveunCG
    hello
    Valentin Soulas
    @soulasvalentin
    Hello guys. I'm trying to connect an ASP.NET Core 2.0 MVC application (Azure web app) to a MySql local server (Mysql in app) with pomelo 2.0.1 and I keep getting the same error: 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?
    @aborderon About migrations. I had a similar problem. Then I just created the script using script-migrate and ran it.
    Chaos
    @ChaosEngine
    @valensoulas I could reproduce the same error by breaking my ConnectionString host name. Check that it is correct and accessible
    Roman Popovici
    @lambidu
    Hello guys, is anybody here?
    Chaos
    @ChaosEngine
    Yup, what is your issue?
    Denis Lopatin
    @DSpade-r
    Hello, author. Tell me, please, now I can use the pre-release version(Core 2.1)? From the resource myGET, the link for the Nuget console can not work.
    Denis Lopatin
    @DSpade-r
    Oh, sorry, my mistake - did not set up nuGET
    Denis Lopatin
    @DSpade-r
    QueryTypes does not work yet?
    Denis Lopatin
    @DSpade-r
    I have exception: Method not found: 'Void Microsoft.EntityFrameworkCore.Storage.Internal.RelationalParameterBuilder..ctor(Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper)'.
    Bernard Bondos
    @bond-os
    hi, is there a way to use guids without hypens in version 1.1.2?
    slaveoftime
    @albertwoo
    @DSpade-r I face the same issue, I think this is an issue in EF Core because it works fine with EF core 2.0.8 on dotnet sdk 2.1.200.
    brux88
    @brux88
    hi, iam using the pomelo package for ef core mysql connector, but i had the error of migration for renamecolumn, how can i fix?
    J Khalaf
    @Ciwan1859
    Hello everyone
    lousaibiao
    @lousaibiao
    any one?
    HelloKitty
    @HelloKitty
    Is OwnedAttribute implemented in the 2.1 RCs? I'm getting odd exceptions during migrations right now on types marked with Owned saying: Unable to determine the relationship represented by navigation property
    Might not be Pomelo related, migrations fail with SqlServer too. Nevermind!
    Amaury Gomez
    @armagen
    Hello everyone!, I'm trying to publish net core 2.1 project with pomelo rc 2.1 on rhel 7,I have this error with MySql.Data.MySqlClient.MySqlException (0x80004005): The user specified as a definer ('admin'@'localhost') does not exist ---> MySql.Data.MySqlClient.MySqlException (0x80004005): The user specified as a definer ('admin'@'localhost') does not exist
    at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in C:\projects\mysqlconnector\src\MySqlConnector\Core\ResultSet.cs:line 44, and i dont have on any part of my project that route , run very well at windows
    Nobonex
    @Nobonex
    Hello guys. I'm having an issue where a migration tries to drop a primary key, but the routine is called with NULL as the schema name
    Thus causing an error
    Nobonex
    @Nobonex
    Robert Rajakone
    @robie2011
    Hello,
    Does pomelo efcore lib validate annotations like MaxLength ?
    Samuel Lewis
    @networkhorse

    Hey guys. Just getting started with Pomelo but bumping into countless issues on 3.2.4 and 5.0.0-alpha-1.

    I was initially trying to use lazy loading to get related entities. I don't have any FKs defined in my database, but I was hoping that the conventions would work. They didn't. I ended up landing myself with a bunch of InvalidOperationExceptions from EF Core.

    I then realised I can use dependency injection to give me my DbContext in my model constructor. I essentially implemented my own "lazy loading" in my models, however that didn't go so well either because now I am getting "Cannot set MySqlCommand.CommandText when there is an open DataReader for this command; it must be closed first.".

    My question is this: is there a way to turn on Lazy Loading in C# using MySQL and just have it work?

    I effectively started with this:

    class User
    {
        public Guid UserId { get; set; }
        public List<WebSession> WebSessions { get; set; }
    }
    
    class WebSession
    {
        public Guid WebSessionId { get; set; }
        public Guid UserId { get; set; }
    
        public User User { get; set; }
    }

    I was hoping I could simply do:

    var user = dbContext.Users.FirstOrDefault();
    var sessions = user.WebSessions;
    Samuel Lewis
    @networkhorse
    Solution: don't use Pomelo. I got this working with:
    • Microsoft.EntityFrameWorkCore v5.0.5
    • Microsoft.EntityFrameworkCore.Proxies v5.0.5
    • Microsoft.EntityFrameworkCore.Relational v5.0.5
    • MySql.EntityFrameworkCore v5.0.0
    Lacks GUID support but that's not a bad price to pay for the functionality haha :)
    gokhansarapevi
    @gokhansarapevi

    Hi everybody, I just have a simple question and I hope someone here can answer that. I am using MariaDb in my production environment so Pomelo is my hero. But in developement I user sql server and one of my crud actions needs to return the id of a newly inserted entity. It was working just fine with sql server but when I changed it to MariaDB and uploaded to my online server it started returning a 500 error. When I inspected the trace, I saw that the entity is inserted to the db but next operations have failed. Those are rely on the Id that has been created when the entity being inserted.

    public async Task<TEntity> AddAsync(TEntity entity)
            {
                using (TContext context = new TContext())
                {
                    //var addedEntity = context.Entry(entity);
                    //addedEntity.State = EntityState.Added;
                    context.Add(entity);
                    await context.SaveChangesAsync();
    
                    //var value = addedEntity.GetDatabaseValues().GetType().GetProperty("Id").GetValue(entity, null);
                    return entity;
                }
            }

    I tried using quoted lines but when I do that, the manager operation says int has no awaiter, so I changed it to entity but no luck. It keeps throwing. How can I safely retrieve the id in a generic pattern like this? I have a business layer and I am calling db operations in that section, then in my API controllers, I just call an operation and return ok or badrequest according to the status. Thanks in advance.

    Chaos
    @ChaosEngine

    Hi everybody, I just have a simple question and I hope someone here can answer that. I am using MariaDb in my production environment so Pomelo is my hero. But in developement I user sql server and one of my crud actions needs to return the id of a newly inserted entity. It was working just fine with sql server but when I changed it to MariaDB and uploaded to my online server it started returning a 500 error. When I inspected the trace, I saw that the entity is inserted to the db but next operations have failed. Those are rely on the Id that has been created when the entity being inserted.

    public async Task<TEntity> AddAsync(TEntity entity)
            {
                using (TContext context = new TContext())
                {
                    //var addedEntity = context.Entry(entity);
                    //addedEntity.State = EntityState.Added;
                    context.Add(entity);
                    await context.SaveChangesAsync();
    
                    //var value = addedEntity.GetDatabaseValues().GetType().GetProperty("Id").GetValue(entity, null);
                    return entity;
                }
            }

    I tried using quoted lines but when I do that, the manager operation says int has no awaiter, so I changed it to entity but no luck. It keeps throwing. How can I safely retrieve the id in a generic pattern like this? I have a business layer and I am calling db operations in that section, then in my API controllers, I just call an operation and return ok or badrequest according to the status. Thanks in advance.

    Could you use this pattern? I have it working on my side:

       public virtual async Task<TEntity> AddAsync(TEntity entity)
       {
           var ent_entry = await _entities.Set<TEntity>().AddAsync(entity);
           return ent_entry.Entity;
       }

    But I must confess, my db of choice is mysql-8

    gokhansarapevi
    @gokhansarapevi
    Hi, I reproduced the problem in my local and it turns out the id value returns but I have a missing injection so the operation fails after that line. So if anybody ever needs something generic that returns the entity the one that I mention works with MariaDB.
    Chaos
    @ChaosEngine
    @gokhansarapevi :thumbsup: