I’m working on a C# project that needs to connect to a MySQL database using LINQ queries, and I’m running everything on Mono. There are several different libraries out there that claim to support LINQ with MySQL, but I’m not sure which one works best with Mono.
I currently have a basic application that runs daily to update some database records. It’s pretty simple right now but I want to upgrade it to use LINQ instead of plain SQL commands. The whole thing runs on an older Linux server with Mono installed.
Can anyone recommend which MySQL LINQ provider has the best compatibility and stability when used with Mono? I’d really appreciate hearing about your experiences with different options.
i used MySQL Connector/Net too, and it works great with LINQ on Mono! took me a bit to set up, but now it’s smooth sailing. Performance is solid for daily tasks, def recommend giving it a shot!
I’ve been using Entity Framework with MySql.Data.EntityFramework on Mono for about two years now - works great for automated database updates. Setup’s a bit tricky at first though. Make sure your connection string’s right in app.config and you’re using the correct provider name. Pro tip: test your LINQ queries thoroughly on Mono first. Some complex queries that work fine on Windows act weird on Mono. Performance is decent for daily batch jobs, though it’s a bit slower than raw SQL commands. It’s definitely stable enough for production if you set it up carefully.
NHibernate with MySQL has worked great for me on Mono. Switched from raw SQL three years ago and never went back. Yeah, it’s harder to learn than the other options here, but once you nail the mapping configs, it handles complex relationships like a champ. Runs solid across different Mono versions - I’ve used it on 4.6 through 6.8 with no major headaches. HQL gives you way more control than LINQ when you need those tricky batch operations. Memory usage stays reasonable even with big datasets.
check out dapper too - i’ve been using it with mysql on mono for basic crud stuff and it’s super lightweight. you get clean object mapping without orm bloat. perfect for daily update jobs when you dont want efs complexity.
I’ve been using ServiceStack.OrmLite for MySQL on Mono and it’s been great. Switched after Entity Framework gave me nothing but headaches on older Mono versions. It’s lightweight, handles LINQ-to-SQL really well, and doesn’t have EF’s bloat. Easy NuGet install, good docs. Been running it in production for batch jobs like yours for over a year - zero stability problems. Clean syntax if you’re used to raw SQL. Best part? No messy config files needed - just drop in your connection string and you’re good to go.