1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. GTA Network forum is now in archive mode.

EntityFramework/LINQ/MySQL example

Discussion in 'Tutorials/Documentations' started by Eraknelo, Jan 18, 2017.

  1. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    For the third and final example, here's a MySQL LINQ integration example.
    Does not include a portable MySQL server, so you'll have to host that yourself obviously.

    Includes automatic migrations for MySQL as well.

    Untested on Linux.

    Download/contribute
     
    Jingles and Moreno like this.
  2. Garik0w

    Garik0w Member

    Messages:
    19
    Likes Received:
    1
    Joined:
    Jan 18, 2017
    How install it? sorry im begginer on GTA:N
     
  3. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    This is probably not for you then ;-)

    It's an example on how to use LINQ with MySQL for scripters.
     
  4. Garik0w

    Garik0w Member

    Messages:
    19
    Likes Received:
    1
    Joined:
    Jan 18, 2017
    I understand, but if I want my server to save / load data in mysql, I need to use this, how would it do?
     
  5. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    I don't think you understand. This is a coding sample. You need to program something yourself, and you can use the code in this example to see how to communicate with a MySQL database.

    It doesn't do anything by itself. You don't install it. It's a code sample for programmers.
     
  6. Moreno

    Moreno Member

    Messages:
    6
    Likes Received:
    0
    Joined:
    Jan 1, 2017
    Why there's not a link to the Main.cs in the meta.xml?
     
  7. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    It's a compiled resource. It only includes the .dll
     
    Moreno likes this.
  8. Thias_Nietli

    Thias_Nietli Member

    Messages:
    13
    Likes Received:
    1
    Joined:
    Jan 1, 2017
    I have this problem with entity framework:

    System.InvalidOperationException: No connection string named 'Entities1' could be found in the application config file.
     
  9. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    Interesting, did you modify the DefaultDbContext.cs file in any way?
     
  10. Thias_Nietli

    Thias_Nietli Member

    Messages:
    13
    Likes Received:
    1
    Joined:
    Jan 1, 2017
    Sorry i didn't show your project i use a entity framework to create in automatic che object!
     
  11. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    What do you think the example project is for? >.>
    Use it, as an example.
     
  12. Thias_Nietli

    Thias_Nietli Member

    Messages:
    13
    Likes Received:
    1
    Joined:
    Jan 1, 2017
    mmmmh i test your project but you create a database table from object class not database to object class <.<
     
  13. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    Yes, the way you're supposed to do it :=D
     
  14. MassDivide

    MassDivide Active Member

    Messages:
    69
    Likes Received:
    15
    Joined:
    Dec 23, 2016
    Hey i'm sure we all appreciate the work @Eraknelo. But you know this is the tutorial section right? Maybe get a mod to move this over to scripting resources?
     
  15. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    I just had it moved from there. It's not really a resource either. Doesn't do anything.
     
  16. afterdarks

    afterdarks New Member

    Messages:
    2
    Likes Received:
    0
    Joined:
    Apr 12, 2017
    Hey, thank's a lot for the share, I'm kinda to new to c# and I've spent a day trying to figure out how to make a decent login & register system for my server and this just kind of saved me.
     
    Last edited: Apr 14, 2017
  17. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    Yeah, I was struggling to set up entity framework myself for GTA N, glad I could save you some time :=)
     
  18. Vikos Taredi

    Vikos Taredi Member

    Messages:
    12
    Likes Received:
    0
    Joined:
    Apr 7, 2017
    Thanks, man! Use it for project
     
  19. Bitdevil2016

    Bitdevil2016 Member

    Messages:
    24
    Likes Received:
    0
    Joined:
    May 14, 2017
    Good day,
    What are the possibilities to run MySql Linq on Linux with Mono?
     
  20. croky

    croky Active Member

    Messages:
    68
    Likes Received:
    3
    Joined:
    Jan 4, 2017
    Why is this in tutorials/documentation if there is no explanation? Put it in scripts or snippets, squishing my brains here to understand something.
     

Share This Page