subsonic / SubSonic-3.0

SubSonic 3.0 for the .NET 3.5 Framework
http://subsonic.github.io/
557 stars 209 forks source link

SubSonic to .NET Core conversion #288

Closed MichaelSteinecke closed 4 years ago

MichaelSteinecke commented 4 years ago

As an exercise to convert .NET Framework projects to .NET Core, I picked up SubSonic as a random project. With this Pull Request I'd like to publish my work back.

The projects in the solution are now multi targeted to .NET Core 3.1, .NET Framework 4.8 and SubSonic.Core to netstandard2.1 as well. xUnit has no support for netstandard yet, so I've ommited that.

Also I've ommited to verify the function of the MYSQL tests. Please do so when integrating by defining MYSQL for SubSonic.Tests.csproj. I expect the tests to work when the server is available. All other tests are green.

I've tested nothing else beyond the included unit tests. There should no functional changes other then the requirement to register DbDataProviders programmatically, but I can't assure that.

6pac commented 4 years ago

Thanks @Torgrimm, I'd note that the last commit was in 2011 and the project is effectively dead. PetaPoco/Massive/Mighty/Dapper have taken up in its place. There may be a few legacy projects around that still use SS3, but unfortunately I don't think anyone would be starting a new one with SubSonic. Hope you had an instructional time, anyway!

qstarin commented 3 years ago

Just a heads up that this change doesn't build. The calls to DbProviderFactories.RegisterFactory in PerfRunner/Program.cs contain invalid identifiers that should be string constants instead.

I'm one of the likely few that has a significant legacy project with too much Subsonic code to have removed it all, but we need to proceed to targeting Core runtime anyway.

SubSonic.Core will work against Core runtimes (at least 2.2 & 3.1) by simply referencing one of the few Core-compatible re-implementations of System.Data.Linq floating around, like Mindbox.Data.Linq.

The multi-targeting change here is awkward to utilize without a corresponding hosted Nuget package, and of course netstandard2.0 can't be simply targeted due to the dependency on DbProviderFactories.

6pac commented 3 years ago

Sure. The fact that my latest commit was 10 years ago says it all for me.

I moved onto PetaPoco ages ago. It uses the same code gen templates so there is a high degree of compatibility with SS. I'm sure anyone who needs SS3 can use Git to extract the point-in-time version they need.